Skip to content

Commit 611a57e

Browse files
ericyangpanclaude
andcommitted
chore: format configuration files with Biome
- Apply Biome formatting to ESLint, Next.js, and build configs - Update TypeScript, PostCSS, and Wrangler configurations - Format MDX component type definitions - Ensure consistent code style across all config files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent fc9bd26 commit 611a57e

File tree

8 files changed

+56
-90
lines changed

8 files changed

+56
-90
lines changed

eslint.config.mjs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import { dirname } from "path";
2-
import { fileURLToPath } from "url";
3-
import { FlatCompat } from "@eslint/eslintrc";
1+
import { dirname } from 'node:path'
2+
import { fileURLToPath } from 'node:url'
3+
import { FlatCompat } from '@eslint/eslintrc'
44

5-
const __filename = fileURLToPath(import.meta.url);
6-
const __dirname = dirname(__filename);
5+
const __filename = fileURLToPath(import.meta.url)
6+
const __dirname = dirname(__filename)
77

88
const compat = new FlatCompat({
99
baseDirectory: __dirname,
10-
});
10+
})
1111

12-
const eslintConfig = [
13-
...compat.extends("next/core-web-vitals", "next/typescript"),
14-
];
12+
const eslintConfig = [...compat.extends('next/core-web-vitals', 'next/typescript')]
1513

16-
export default eslintConfig;
14+
export default eslintConfig

mdx-components.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { MDXComponents } from 'mdx/types';
2-
import { useMDXComponents as getMDXComponents } from '@/components/MDXComponents';
1+
import type { MDXComponents } from 'mdx/types'
2+
import { useMDXComponents as getMDXComponents } from '@/components/MDXComponents'
33

44
export function useMDXComponents(components: MDXComponents): MDXComponents {
5-
return getMDXComponents(components);
5+
return getMDXComponents(components)
66
}

mdx.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
declare module '*.mdx' {
2-
import { MDXProps } from 'mdx/types';
3-
export default function MDXContent(props: MDXProps): JSX.Element;
2+
import { MDXProps } from 'mdx/types'
3+
export default function MDXContent(props: MDXProps): JSX.Element
44
}

next.config.ts

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
import type { NextConfig } from "next";
2-
import createMDX from '@next/mdx';
3-
import remarkFrontmatter from 'remark-frontmatter';
4-
import remarkMdxFrontmatter from 'remark-mdx-frontmatter';
5-
import remarkGfm from 'remark-gfm';
6-
import bundleAnalyzer from '@next/bundle-analyzer';
7-
import createNextIntlPlugin from 'next-intl/plugin';
1+
import bundleAnalyzer from '@next/bundle-analyzer'
2+
import createMDX from '@next/mdx'
3+
import type { NextConfig } from 'next'
4+
import createNextIntlPlugin from 'next-intl/plugin'
5+
import remarkFrontmatter from 'remark-frontmatter'
6+
import remarkGfm from 'remark-gfm'
7+
import remarkMdxFrontmatter from 'remark-mdx-frontmatter'
88

9-
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts');
9+
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts')
1010

1111
const withBundleAnalyzer = bundleAnalyzer({
1212
enabled: process.env.ANALYZE === 'true',
13-
});
13+
})
1414

1515
// Security headers configuration
1616
const securityHeaders = [
1717
{
1818
key: 'X-DNS-Prefetch-Control',
19-
value: 'on'
19+
value: 'on',
2020
},
2121
{
2222
key: 'X-Frame-Options',
23-
value: 'SAMEORIGIN'
23+
value: 'SAMEORIGIN',
2424
},
2525
{
2626
key: 'X-Content-Type-Options',
27-
value: 'nosniff'
27+
value: 'nosniff',
2828
},
2929
{
3030
key: 'Referrer-Policy',
31-
value: 'strict-origin-when-cross-origin'
31+
value: 'strict-origin-when-cross-origin',
3232
},
3333
{
3434
key: 'Permissions-Policy',
35-
value: 'camera=(), microphone=(), geolocation=()'
35+
value: 'camera=(), microphone=(), geolocation=()',
3636
},
37-
];
37+
]
3838

3939
const nextConfig: NextConfig = {
4040
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
@@ -67,26 +67,18 @@ const nextConfig: NextConfig = {
6767

6868
// Experimental features for better performance
6969
experimental: {
70-
optimizePackageImports: [
71-
'lucide-react',
72-
'next-intl',
73-
'@mdx-js/react',
74-
'gray-matter',
75-
],
76-
// Turbopack configuration (Next.js 15+)
77-
turbo: {
78-
rules: {
79-
// Add custom turbopack rules if needed
80-
},
81-
},
70+
optimizePackageImports: ['lucide-react', 'next-intl', '@mdx-js/react', 'gray-matter'],
8271
},
8372

8473
// Compiler optimizations
8574
compiler: {
8675
// Remove console logs in production (keep error and warn)
87-
removeConsole: process.env.NODE_ENV === 'production' ? {
88-
exclude: ['error', 'warn']
89-
} : false,
76+
removeConsole:
77+
process.env.NODE_ENV === 'production'
78+
? {
79+
exclude: ['error', 'warn'],
80+
}
81+
: false,
9082
},
9183

9284
// TypeScript configuration
@@ -149,20 +141,21 @@ const nextConfig: NextConfig = {
149141
},
150142
],
151143
},
152-
];
144+
]
153145
},
154-
};
146+
}
155147

156148
const withMDX = createMDX({
157149
extension: /\.mdx?$/,
158150
options: {
159151
remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter, remarkGfm],
160152
rehypePlugins: [],
161153
},
162-
});
154+
})
163155

164-
export default withNextIntl(withBundleAnalyzer(withMDX(nextConfig)));
156+
export default withNextIntl(withBundleAnalyzer(withMDX(nextConfig)))
165157

166158
// added by create cloudflare to enable calling `getCloudflareContext()` in `next dev`
167-
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
168-
initOpenNextCloudflareForDev();
159+
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare'
160+
161+
initOpenNextCloudflareForDev()

open-next.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
1+
import { defineCloudflareConfig } from '@opennextjs/cloudflare'
22

33
export default defineCloudflareConfig({
44
// Uncomment to enable R2 cache,
55
// It should be imported as:
66
// `import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";`
77
// See https://opennext.js.org/cloudflare/caching for more details
88
// incrementalCache: r2IncrementalCache,
9-
});
9+
})

postcss.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const config = {
2-
plugins: ["@tailwindcss/postcss"],
3-
};
2+
plugins: ['@tailwindcss/postcss'],
3+
}
44

5-
export default config;
5+
export default config

tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
"@/*": ["./src/*"],
2323
"@content/*": ["./content/*"]
2424
},
25-
"types": [
26-
"./cloudflare-env.d.ts",
27-
"node"
28-
]
25+
"types": ["./cloudflare-env.d.ts", "node"]
2926
},
3027
"include": ["next-env.d.ts", "mdx.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
3128
"exclude": ["node_modules"]

wrangler.toml

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "aicodingstack"
22
main = ".open-next/worker.js"
3-
compatibility_date = "2025-03-01"
3+
compatibility_date = "2025-11-01"
44
compatibility_flags = [
55
"nodejs_compat",
66
"global_fetch_strictly_public",
@@ -13,37 +13,15 @@ custom_domain = true
1313
[assets]
1414
binding = "ASSETS"
1515
directory = ".open-next/assets"
16+
html_handling = "auto-trailing-slash"
17+
not_found_handling = "single-page-application"
1618

1719
[observability]
1820
enabled = true
21+
head_sampling_rate = 0.1
1922

20-
# Smart Placement
21-
# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
22-
# placement = { mode = "smart" }
23-
24-
# Bindings
25-
# Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including
26-
# databases, object storage, AI inference, real-time communication and more.
27-
# https://developers.cloudflare.com/workers/runtime-apis/bindings/
28-
29-
# Environment Variables
30-
# https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
31-
# [vars]
32-
# MY_VARIABLE = "production_value"
33-
34-
# Note: Use secrets to store sensitive data.
35-
# https://developers.cloudflare.com/workers/configuration/secrets/
36-
37-
# Static Assets (alternative form)
38-
# https://developers.cloudflare.com/workers/static-assets/binding/
39-
# [assets]
40-
# directory = "./public/"
41-
# binding = "ASSETS"
42-
43-
# Service Bindings (communicate between multiple Workers)
44-
# https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
45-
# [[services]]
46-
# binding = "MY_SERVICE"
47-
# service = "my-service"
48-
23+
[placement]
24+
mode = "smart"
4925

26+
[limits]
27+
cpu_ms = 50

0 commit comments

Comments
 (0)