biome.json
{
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"attributePosition": "auto",
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100,
"lineEnding": "lf"
},
"linter": {
"enabled": true,
"domains": {
"next": "all",
"project": "all",
"react": "all",
"test": "all"
},
"rules": {
"recommended": true,
"a11y": {
"noAccessKey": "error",
"noAriaHiddenOnFocusable": "error",
"noAriaUnsupportedElements": "error",
"noAutofocus": "error",
"noDistractingElements": "error",
"noHeaderScope": "error",
"noInteractiveElementToNoninteractiveRole": "error",
"noLabelWithoutControl": {
"level": "error",
"options": {
"inputComponents": ["Input"]
}
},
"noNoninteractiveElementInteractions": "error",
"noNoninteractiveElementToInteractiveRole": "error",
"noNoninteractiveTabindex": "error",
"noPositiveTabindex": "error",
"noRedundantAlt": "error",
"noRedundantRoles": "error",
"noStaticElementInteractions": "error",
"noSvgWithoutTitle": "error",
"useAltText": "error",
"useAnchorContent": "error",
"useAriaActivedescendantWithTabindex": "error",
"useAriaPropsForRole": "error",
"useAriaPropsSupportedByRole": "error",
"useButtonType": "error",
"useFocusableInteractive": "error",
"useHeadingContent": "error",
"useHtmlLang": "error",
"useIframeTitle": "error",
"useKeyWithClickEvents": "error",
"useKeyWithMouseEvents": "error",
"useMediaCaption": "error",
"useSemanticElements": "error",
"useValidAnchor": "error",
"useValidAriaProps": "error",
"useValidAriaRole": "error",
"useValidAriaValues": "error",
"useValidAutocomplete": "error",
"useValidLang": "error",
"useGenericFontNames": "error"
},
"complexity": {
"noAdjacentSpacesInRegex": "error",
"noArguments": "error",
"noBannedTypes": "error",
"noCommaOperator": "error",
"noEmptyTypeParameters": "error",
"noExcessiveCognitiveComplexity": {
"level": "error",
"options": {
"maxAllowedComplexity": 10
}
},
"noExcessiveLinesPerFunction": {
"level": "error",
"options": {
"maxLines": 50
}
},
"noExcessiveNestedTestSuites": "error",
"noExtraBooleanCast": "error",
"noFlatMapIdentity": "error",
"noForEach": "error",
"noImplicitCoercions": "error",
"noStaticOnlyClass": "error",
"noThisInStatic": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
"noUselessContinue": "error",
"noUselessEmptyExport": "error",
"noUselessEscapeInRegex": "error",
"noUselessFragments": "error",
"noUselessLabel": "error",
"noUselessLoneBlockStatements": "error",
"noUselessRename": "error",
"noUselessStringConcat": "error",
"noUselessStringRaw": "error",
"noUselessSwitchCase": "error",
"noUselessTernary": "error",
"noUselessThisAlias": "error",
"noUselessTypeConstraint": "error",
"noUselessUndefinedInitialization": "error",
"noVoid": "error",
"useArrowFunction": "error",
"useDateNow": "error",
"useFlatMap": "error",
"useIndexOf": "error",
"useLiteralKeys": "error",
"useNumericLiterals": "error",
"useOptionalChain": "error",
"useRegexLiterals": "error",
"useSimpleNumberKeys": "error",
"useSimplifiedLogicExpression": "error",
"useWhile": "error",
"noImportantStyles": "error"
},
"correctness": {
"noChildrenProp": "error",
"noConstAssign": "error",
"noConstantCondition": "error",
"noConstantMathMinMaxClamp": "error",
"noConstructorReturn": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalDirnameFilename": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidBuiltinInstantiation": "error",
"noInvalidConstructorSuper": "error",
"noInvalidUseBeforeDeclaration": "error",
"noNestedComponentDefinitions": "error",
"noNodejsModules": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noPrivateImports": "error",
"noProcessGlobal": "error",
"noReactPropAssignments": "error",
"noRenderReturnValue": "error",
"noRestrictedElements": {
"level": "error",
"options": {
"elements": {
"input": "input is not allowed, use Input component instead"
}
}
},
"noSelfAssign": "error",
"noSetterReturn": "error",
"noStringCaseMismatch": "error",
"noSwitchDeclarations": "error",
"noUndeclaredDependencies": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedFunctionParameters": "error",
"noUnusedImports": "error",
"noUnusedLabels": "error",
"noUnusedPrivateClassMembers": "error",
"noUnusedVariables": "error",
"noVoidElementsWithChildren": "error",
"noVoidTypeReturn": "error",
"useExhaustiveDependencies": {
"level": "error",
"options": {
"hooks": [
{
"name": "useQuery",
"closureIndex": 1,
"dependenciesIndex": 0,
"stableResult": ["refetch"]
}
]
}
},
"useHookAtTopLevel": "error",
"useImportExtensions": "off",
"useIsNan": "error",
"useJsonImportAttributes": "error",
"useJsxKeyInIterable": "error",
"useParseIntRadix": "error",
"useSingleJsDocAsterisk": "error",
"useUniqueElementIds": "error",
"useValidForDirection": "error",
"useValidTypeof": "error",
"useYield": "error",
"noInvalidDirectionInLinearGradient": "error",
"noInvalidGridAreas": "error",
"noInvalidPositionAtImportRule": "error",
"noMissingVarFunction": "error",
"noUnknownFunction": "error",
"noUnknownMediaFeatureName": "error",
"noUnknownProperty": "error",
"noUnknownPseudoClass": "error",
"noUnknownPseudoElement": "error",
"noUnknownTypeSelector": "error",
"noUnknownUnit": "error",
"noUnmatchableAnbSelector": "error",
"useGraphqlNamedOperations": "error"
},
"performance": {
"noAccumulatingSpread": "error",
"noAwaitInLoops": "error",
"noBarrelFile": "error",
"noDelete": "error",
"noDynamicNamespaceImportAccess": "error",
"noImgElement": "error",
"noNamespaceImport": "error",
"noReExportAll": "error",
"noUnwantedPolyfillio": "error",
"useGoogleFontPreconnect": "error",
"useTopLevelRegex": "error"
},
"security": {
"noBlankTarget": "error",
"noDangerouslySetInnerHtml": "error",
"noDangerouslySetInnerHtmlWithChildren": "error",
"noGlobalEval": "error"
},
"style": {
"noCommonJs": "error",
"noDefaultExport": "error",
"noDoneCallback": "error",
"noEnum": "error",
"noExportedImports": "error",
"noHeadElement": "error",
"noImplicitBoolean": "off",
"noInferrableTypes": "error",
"noMagicNumbers": "error",
"noNamespace": "error",
"noNegationElse": "error",
"noNestedTernary": "error",
"noNonNullAssertion": "error",
"noParameterAssign": "error",
"noParameterProperties": "error",
"noProcessEnv": "error",
"noRestrictedGlobals": "error",
"noRestrictedImports": {
"level": "error",
"options": {
"patterns": [
{
"group": ["@/app/**/layout.tsx", "@/app/**/page.tsx"]
},
{
"group": ["../**/*"]
}
]
}
},
"noRestrictedTypes": {
"level": "error",
"options": {
"types": {
"Item": "Cannot use misleading name type"
}
}
},
"noShoutyConstants": "error",
"noSubstr": "error",
"noUnusedTemplateLiteral": "error",
"noUselessElse": "error",
"noYodaExpression": "error",
"useArrayLiterals": "error",
"useAsConstAssertion": "error",
"useAtIndex": "error",
"useBlockStatements": "error",
"useCollapsedElseIf": "error",
"useCollapsedIf": "error",
"useComponentExportOnlyModules": "error",
"useConsistentArrayType": {
"level": "error",
"options": {
"syntax": "shorthand"
}
},
"useConsistentBuiltinInstantiation": "error",
"useConsistentCurlyBraces": "error",
"useConsistentMemberAccessibility": "error",
"useConsistentObjectDefinitions": "error",
"useConst": "error",
"useDefaultParameterLast": "error",
"useDefaultSwitchClause": "error",
"useEnumInitializers": "error",
"useExplicitLengthCheck": "error",
"useExponentiationOperator": "error",
"useExportType": "error",
"useExportsLast": "error",
"useFilenamingConvention": {
"level": "error",
"options": {
"filenameCases": ["kebab-case"]
}
},
"useForOf": "error",
"useFragmentSyntax": "error",
"useGroupedAccessorPairs": "error",
"useImportType": "error",
"useLiteralEnumMembers": "error",
"useNamingConvention": {
"level": "error",
"options": {
"conventions": [
{
"selector": {
"kind": "let"
},
"match": ""
}
]
}
},
"useNodeAssertStrict": "error",
"useNodejsImportProtocol": "error",
"useNumberNamespace": "error",
"useNumericSeparators": "error",
"useObjectSpread": "error",
"useReadonlyClassProperties": "error",
"useSelfClosingElements": "error",
"useShorthandAssign": "error",
"useShorthandFunctionType": "error",
"useSingleVarDeclarator": "error",
"useSymbolDescription": "error",
"useTemplate": "error",
"useThrowNewError": "error",
"useThrowOnlyError": "error",
"useTrimStartEnd": "error",
"useUnifiedTypeSignatures": "error",
"noDescendingSpecificity": "error",
"noValueAtRule": "error",
"useDeprecatedReason": "error",
"useGraphqlNamingConvention": "error"
},
"suspicious": {
"noAlert": "error",
"noApproximativeNumericConstant": "error",
"noArrayIndexKey": "error",
"noAssignInExpressions": "error",
"noAsyncPromiseExecutor": "error",
"noBitwiseOperators": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noConfusingLabels": "error",
"noConfusingVoidType": "error",
"noConsole": "error",
"noConstEnum": "error",
"noConstantBinaryExpressions": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDocumentCookie": "error",
"noDocumentImportInPage": "error",
"noDoubleEquals": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateElseIf": "error",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noDuplicateTestHooks": "error",
"noEmptyBlockStatements": "error",
"noEmptyInterface": "error",
"noEvolvingTypes": "error",
"noExplicitAny": "error",
"noExportsInTest": "error",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFocusedTests": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noGlobalIsFinite": "error",
"noGlobalIsNan": "error",
"noHeadImportInDocument": "error",
"noImplicitAnyLet": "error",
"noImportAssign": "error",
"noIrregularWhitespace": "error",
"noLabelVar": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noMisplacedAssertion": "error",
"noMisrefactoredShorthandAssign": "error",
"noOctalEscape": "error",
"noPrototypeBuiltins": "error",
"noReactSpecificProps": "off",
"noRedeclare": "error",
"noRedundantUseStrict": "error",
"noSelfCompare": "error",
"noShadowRestrictedNames": "error",
"noSkippedTests": "error",
"noSparseArray": "error",
"noSuspiciousSemicolonInJsx": "error",
"noTemplateCurlyInString": "error",
"noThenProperty": "error",
"noTsIgnore": "error",
"noUnassignedVariables": "error",
"noUnsafeDeclarationMerging": "error",
"noUnsafeNegation": "error",
"noUselessEscapeInString": "error",
"noUselessRegexBackrefs": "error",
"noVar": "error",
"noWith": "error",
"useAdjacentOverloadSignatures": "error",
"useAwait": "error",
"useDefaultSwitchClauseLast": "error",
"useErrorMessage": "error",
"useGetterReturn": "error",
"useGoogleFontDisplay": "error",
"useGuardForIn": "error",
"useIsArray": "error",
"useIterableCallbackReturn": "error",
"useNamespaceKeyword": "error",
"useNumberToFixedDigitsArgument": "error",
"useStaticResponseMethods": "error",
"useStrictMode": "error",
"noDuplicateAtImportRules": "error",
"noDuplicateCustomProperties": "error",
"noDuplicateFontNames": "error",
"noDuplicateProperties": "error",
"noDuplicateSelectorsKeyframeBlock": "error",
"noEmptyBlock": "error",
"noImportantInKeyframe": "error",
"noShorthandPropertyOverrides": "error",
"noUnknownAtRules": "error",
"noBiomeFirstException": "error",
"noQuickfixBiome": "error",
"useBiomeIgnoreFolder": "error",
"noDuplicateFields": "error"
}
}
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"quoteStyle": "double",
"semicolons": "asNeeded",
"trailingCommas": "es5"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on",
"useSortedAttributes": "off",
"useSortedKeys": "off",
"useSortedProperties": "off"
}
}
},
"overrides": [
{
"includes": [
"next.config.ts",
"postcss.config.mjs",
"src/app/**/layout.tsx",
"src/app/**/page.tsx"
],
"linter": {
"rules": {
"style": {
"noDefaultExport": "off"
}
}
}
},
{
"includes": ["src/app/**/layout.tsx"],
"linter": {
"rules": {
"style": {
"useComponentExportOnlyModules": "off"
}
}
}
}
]
}
補足
- Next向けです
- Biome v2.2.0です
settings.json
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit",
"source.fixAll.biome": "explicit",
"source.suppressRule.inline.biome": "never",
"source.suppressRule.topLevel.biome": "never"
}