Upgrade Biome to 2.4.7 and enable 54 additional lint rules
Add rules covering bug prevention (noLeakedRender, noFloatingPromises, noImportCycles, noReactForwardRef), security (noScriptUrl, noAlert), performance (noAwaitInLoops, useTopLevelRegex), and code style (noNestedTernary, useGlobalThis, useNullishCoalescing, useSortedClasses, plus ~40 more). Fix all violations: extract top-level regex constants, guard React && renders with boolean coercion, refactor nested ternaries, replace window with globalThis, sort Tailwind classes, and introduce expectDomainError test helper to eliminate conditional expects. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
102
biome.json
102
biome.json
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.4.7/schema.json",
|
||||
"files": {
|
||||
"includes": [
|
||||
"**",
|
||||
"!**/dist/**",
|
||||
"!.claude/**",
|
||||
"!.specify/**",
|
||||
"!specs/**",
|
||||
"!coverage/**",
|
||||
"!.pnpm-store/**"
|
||||
"!**/dist",
|
||||
"!.claude",
|
||||
"!.specify",
|
||||
"!specs",
|
||||
"!coverage",
|
||||
"!.pnpm-store"
|
||||
]
|
||||
},
|
||||
"assist": {
|
||||
@@ -21,6 +21,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"css": {
|
||||
"parser": {
|
||||
"cssModules": false,
|
||||
"tailwindDirectives": true
|
||||
}
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "tab",
|
||||
@@ -30,13 +36,93 @@
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"a11y": {
|
||||
"noNoninteractiveElementInteractions": "error"
|
||||
},
|
||||
"complexity": {
|
||||
"noExcessiveCognitiveComplexity": {
|
||||
"level": "error",
|
||||
"options": {
|
||||
"maxAllowedComplexity": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
"noUselessStringConcat": "error"
|
||||
},
|
||||
"correctness": {
|
||||
"noNestedComponentDefinitions": "error",
|
||||
"noReactPropAssignments": "error"
|
||||
},
|
||||
"nursery": {
|
||||
"noConditionalExpect": "error",
|
||||
"noDuplicatedSpreadProps": "error",
|
||||
"noFloatingPromises": "error",
|
||||
"noLeakedRender": "error",
|
||||
"noMisusedPromises": "error",
|
||||
"noNestedPromises": "error",
|
||||
"noReturnAssign": "error",
|
||||
"noScriptUrl": "error",
|
||||
"noShadow": "error",
|
||||
"noUnnecessaryConditions": "error",
|
||||
"noUselessReturn": "error",
|
||||
"useArraySome": "error",
|
||||
"useArraySortCompare": "error",
|
||||
"useAwaitThenable": "error",
|
||||
"useErrorCause": "error",
|
||||
"useExhaustiveSwitchCases": "error",
|
||||
"useFind": "error",
|
||||
"useGlobalThis": "error",
|
||||
"useNullishCoalescing": "error",
|
||||
"useRegexpExec": "error",
|
||||
"useSortedClasses": "error",
|
||||
"useSpread": "error"
|
||||
},
|
||||
"performance": {
|
||||
"noAwaitInLoops": "error",
|
||||
"useTopLevelRegex": "error"
|
||||
},
|
||||
"style": {
|
||||
"noCommonJs": "error",
|
||||
"noDoneCallback": "error",
|
||||
"noExportedImports": "error",
|
||||
"noInferrableTypes": "error",
|
||||
"noNamespace": "error",
|
||||
"noNegationElse": "error",
|
||||
"noNestedTernary": "error",
|
||||
"noParameterAssign": "error",
|
||||
"noSubstr": "error",
|
||||
"noUnusedTemplateLiteral": "error",
|
||||
"noUselessElse": "error",
|
||||
"noYodaExpression": "error",
|
||||
"useAsConstAssertion": "error",
|
||||
"useAtIndex": "error",
|
||||
"useCollapsedElseIf": "error",
|
||||
"useCollapsedIf": "error",
|
||||
"useConsistentBuiltinInstantiation": "error",
|
||||
"useDefaultParameterLast": "error",
|
||||
"useExplicitLengthCheck": "error",
|
||||
"useForOf": "error",
|
||||
"useFragmentSyntax": "error",
|
||||
"useNumberNamespace": "error",
|
||||
"useSelfClosingElements": "error",
|
||||
"useShorthandAssign": "error",
|
||||
"useThrowNewError": "error",
|
||||
"useThrowOnlyError": "error",
|
||||
"useTrimStartEnd": "error"
|
||||
},
|
||||
"suspicious": {
|
||||
"noAlert": "error",
|
||||
"noConstantBinaryExpressions": "error",
|
||||
"noDeprecatedImports": "error",
|
||||
"noEvolvingTypes": "error",
|
||||
"noImportCycles": "error",
|
||||
"noReactForwardRef": "error",
|
||||
"noSkippedTests": "error",
|
||||
"noTemplateCurlyInString": "error",
|
||||
"noTsIgnore": "error",
|
||||
"noUnusedExpressions": "error",
|
||||
"noVar": "error",
|
||||
"useAwait": "error",
|
||||
"useErrorMessage": "error"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user