diff --git a/biome.json b/biome.json index 6e96c75f..a3976d13 100644 --- a/biome.json +++ b/biome.json @@ -1,8 +1,15 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.0/schema.json", "files": { "ignoreUnknown": false, - "ignore": ["node_modules", ".next", "*.css", "src/components/ui/*"] + "includes": [ + "**", + "!**/node_modules", + "!**/.next", + "!**/*.css", + "!**/src/components/ui/**/*", + "!**/public/workers/**" + ] }, "formatter": { "enabled": true, @@ -31,9 +38,10 @@ }, "suspicious": { "noExplicitAny": "warn", - "noConsoleLog": "warn", "noControlCharactersInRegex": "off", - "noShadowRestrictedNames": "off" + "noShadowRestrictedNames": "off", + "noConsole": "warn", + "noArrayIndexKey": "warn" }, "style": { "noNonNullAssertion": "warn", @@ -45,7 +53,5 @@ } } }, - "organizeImports": { - "enabled": true - } + "assist": { "actions": { "source": { "organizeImports": "on" } } } } diff --git a/scripts/nextjs-list-pages.ts b/scripts/nextjs-list-pages.ts index 2fb7038b..9c23e16e 100644 --- a/scripts/nextjs-list-pages.ts +++ b/scripts/nextjs-list-pages.ts @@ -41,14 +41,20 @@ const htmlFiles = walk(serverDir) .sort(); console.log("\n📄 Static HTML files emitted:"); -htmlFiles.forEach((p) => console.log(" •", p)); +htmlFiles.forEach((p) => { + console.log(" •", p); +}); console.log("\n📦 SSG routes from prerender‑manifest.json:"); -ssgRoutes.forEach((p) => console.log(" •", p)); +ssgRoutes.forEach((p) => { + console.log(" •", p); +}); if (dynamicSsgRoutes.length) { console.log("\n📦 Dynamic SSG routes (ISR/fallback):"); - dynamicSsgRoutes.forEach((p) => console.log(" •", p)); + dynamicSsgRoutes.forEach((p) => { + console.log(" •", p); + }); } console.log("\n✅ Done."); diff --git a/src/app/(app)/bones/cli-www/_components/component-details.tsx b/src/app/(app)/bones/cli-www/_components/component-details.tsx index 2f1e500c..75bcbdb9 100644 --- a/src/app/(app)/bones/cli-www/_components/component-details.tsx +++ b/src/app/(app)/bones/cli-www/_components/component-details.tsx @@ -38,7 +38,7 @@ export function ComponentDetails({ }: ComponentDetailsProps) { const [selectedFile, setSelectedFile] = useState() - const handleKeyDown = (e: KeyboardEvent) => { + const handleKeyDown = (e: KeyboardEvent) => { if (e.key === 'Escape') { onClose() } @@ -61,12 +61,12 @@ export function ComponentDetails({ return ( <> -
( ({ className, size, color, label, ...props }, ref) => { return ( + // biome-ignore lint/a11y/useSemanticElements: keeping a div preserves the exported HTMLDivElement ref type
{ {`Random )} diff --git a/src/lib/utils/extract-headings.ts b/src/lib/utils/extract-headings.ts index a9ac58c5..9d40dce1 100644 --- a/src/lib/utils/extract-headings.ts +++ b/src/lib/utils/extract-headings.ts @@ -58,7 +58,9 @@ function ensureCacheSize(): void { entries.sort((a, b) => a[1].timestamp - b[1].timestamp); const toRemove = entries.slice(0, headingCache.size - MAX_CACHE_SIZE + 1); - toRemove.forEach(([key]) => headingCache.delete(key)); + toRemove.forEach(([key]) => { + headingCache.delete(key); + }); } } @@ -89,9 +91,8 @@ export function extractHeadings(content: string): Heading[] { // Extract headings if not in cache or expired const headingRegex = /^(#{1,6})\s+(.+)$/gm; const headings: Heading[] = []; - let match; - while ((match = headingRegex.exec(content)) !== null) { + for (const match of content.matchAll(headingRegex)) { const level = match[1]?.length ?? 0; const text = match[2]?.trim() ?? ""; const id = slugify(text); diff --git a/tests/setup.ts b/tests/setup.ts index 9ae044a0..13c96326 100644 --- a/tests/setup.ts +++ b/tests/setup.ts @@ -5,7 +5,7 @@ import { afterEach, beforeAll, expect, vi } from "vitest"; // Augment the global namespace for TypeScript declare global { - // biome-ignore lint/style/noVar: + // biome-ignore lint/suspicious/noVar: global augmentation requires var var IS_REACT_ACT_ENVIRONMENT: boolean; }