diff --git a/biome.json b/biome.json index 055095ed77..e12691bf42 100644 --- a/biome.json +++ b/biome.json @@ -27,6 +27,7 @@ "!!**/dist", "!!**/build", "!!**/public", + "!!companion", "!!public", "!!apps/web/public/embed", "!!packages/prisma/zod", @@ -59,19 +60,89 @@ }, "linter": { "enabled": true, + "domains": { + "next": "recommended", + "react": "recommended" + }, "rules": { "recommended": true, - "correctness": "warn", - "suspicious": "warn", - "complexity": "warn", - "performance": "warn", - "nursery": "warn", - "a11y": "warn", - "style": "warn", - "security": "warn" + "a11y": "off" } }, "overrides": [ + { + "includes": ["**/*.tsx"], + "javascript": { + "jsxRuntime": "transparent" + } + }, + { + "includes": [ + "apps/web/app/**/page.tsx", + "apps/web/app/**/layout.tsx", + "apps/web/app/pages/**/*.tsx" + ], + "linter": { + "rules": { + "style": { + "noDefaultExport": "off" + } + } + } + }, + { + "includes": ["**/*"], + "linter": { + "rules": { + "nursery": { + "useQwikValidLexicalScope": "warn", + "useExplicitType": "warn", + "noReactForwardRef": "warn", + "noTernary": "warn", + "noUnresolvedImports": "warn" + }, + "correctness": { + "useImportExtensions": "warn", + "noProcessGlobal": "warn", + "useExhaustiveDependencies": "warn", + "noUnknownProperty": "warn", + "noUnreachable": "warn", + "noEmptyPattern": "warn", + "noSwitchDeclarations": "warn", + "useHookAtTopLevel": "warn", + "useJsxKeyInIterable": "warn", + "noUnsafeOptionalChaining": "warn" + }, + "style": { + "useExportsLast": "warn", + "noProcessEnv": "warn" + }, + "complexity": { + "noExcessiveLinesPerFunction": "warn" + }, + "performance": { + "noImgElement": "warn" + }, + "suspicious": { + "noReactSpecificProps": "warn", + "noDoubleEquals": "warn", + "noAssignInExpressions": "warn", + "noExplicitAny": "warn", + "useIterableCallbackReturn": "warn", + "noImplicitAnyLet": "warn", + "noRedeclare": "warn", + "noControlCharactersInRegex": "warn", + "noArrayIndexKey": "warn", + "noShadowRestrictedNames": "warn", + "noAsyncPromiseExecutor": "warn" + }, + "security": { + "noBlankTarget": "warn", + "noDangerouslySetInnerHtml": "warn" + } + } + } + }, { "includes": ["packages/lib/**/*.{ts,tsx,js,jsx,mts,mjs,cjs,cts}"], "linter": { @@ -167,22 +238,6 @@ } } } - }, - { - "includes": ["companion/**/*.{ts,tsx,js,jsx}"], - "javascript": { - "formatter": { - "lineWidth": 100 - } - } - }, - { - "includes": ["apps/website/lib/utils/wordlist/wordlist.ts"], - "javascript": { - "formatter": { - "quoteProperties": "preserve" - } - } } ] } diff --git a/lint-staged.config.mjs b/lint-staged.config.mjs index fe534bd17b..e31db66098 100644 --- a/lint-staged.config.mjs +++ b/lint-staged.config.mjs @@ -1,10 +1,12 @@ -const skipWarnings = ["1", "true", "yes", "on"].includes((process.env.SKIP_WARNINGS ?? "").toLowerCase()); +const skipWarnings = ["1", "true", "yes", "on"].includes( + (process.env.SKIP_WARNINGS ?? "").toLowerCase() +); export default { "(apps|packages|companion)/**/*.{js,ts,jsx,tsx}": (files) => skipWarnings - ? `biome lint --write ${files.join(" ")}` - : `biome lint --write --error-on-warnings ${files.join(" ")}`, - "*.json": (files) => `biome format --write ${files.join(" ")}`, + ? `biome lint ${files.join(" ")}` + : `biome lint --error-on-warnings ${files.join(" ")}`, + "*.json": (files) => `biome format ${files.join(" ")}`, "packages/prisma/schema.prisma": ["prisma format"], }; diff --git a/packages/coss-ui/src/components/breadcrumb.tsx b/packages/coss-ui/src/components/breadcrumb.tsx index d325b54d68..c3dc54a4a3 100644 --- a/packages/coss-ui/src/components/breadcrumb.tsx +++ b/packages/coss-ui/src/components/breadcrumb.tsx @@ -14,7 +14,7 @@ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {