Loading...
Loading...
Use when applying Biome's linting capabilities, rule categories, and code quality enforcement to JavaScript/TypeScript projects.
npx skill4agent add thebushidocollective/han biome-linting# Check files without fixing
biome check .
# Check and auto-fix
biome check --write .
# Check specific files
biome check src/**/*.ts
# CI mode (strict, fails on warnings)
biome ci .# Verbose output
biome check --verbose .
# JSON output
biome check --json .
# Only lint (skip formatting)
biome lint .
# Apply safe fixes only
biome check --write --unsafe=false .{
"linter": {
"rules": {
"a11y": {
"recommended": true,
"noAccessKey": "error",
"noAriaHiddenOnFocusable": "error",
"noAutofocus": "warn",
"noBlankTarget": "error",
"noPositiveTabindex": "error",
"useAltText": "error",
"useAnchorContent": "error",
"useButtonType": "error",
"useValidAriaProps": "error"
}
}
}
}{
"linter": {
"rules": {
"complexity": {
"recommended": true,
"noBannedTypes": "error",
"noExcessiveCognitiveComplexity": "warn",
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
"noUselessEmptyExport": "error",
"noUselessFragments": "error",
"noUselessLabel": "error",
"noUselessRename": "error",
"noUselessSwitchCase": "error",
"noWith": "error"
}
}
}
}{
"linter": {
"rules": {
"correctness": {
"recommended": true,
"noChildrenProp": "error",
"noConstAssign": "error",
"noConstantCondition": "error",
"noConstructorReturn": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidConstructorSuper": "error",
"noNewSymbol": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedLabels": "error",
"noUnusedVariables": "error",
"useIsNan": "error",
"useValidForDirection": "error",
"useYield": "error"
}
}
}
}noUndeclaredVariablesnoUnusedVariablesnoConstAssignnoUnreachableuseIsNan{
"linter": {
"rules": {
"performance": {
"recommended": true,
"noAccumulatingSpread": "warn",
"noDelete": "error"
}
}
}
}{
"linter": {
"rules": {
"security": {
"recommended": true,
"noDangerouslySetInnerHtml": "error",
"noDangerouslySetInnerHtmlWithChildren": "error",
"noGlobalEval": "error"
}
}
}
}{
"linter": {
"rules": {
"style": {
"recommended": true,
"noArguments": "error",
"noCommaOperator": "error",
"noImplicitBoolean": "warn",
"noNegationElse": "warn",
"noNonNullAssertion": "warn",
"noParameterAssign": "error",
"noRestrictedGlobals": "error",
"noShoutyConstants": "warn",
"noUnusedTemplateLiteral": "error",
"noVar": "error",
"useBlockStatements": "warn",
"useCollapsedElseIf": "warn",
"useConst": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "warn",
"useExponentiationOperator": "error",
"useFragmentSyntax": "error",
"useNumericLiterals": "error",
"useSelfClosingElements": "error",
"useShorthandArrayType": "error",
"useSingleVarDeclarator": "error",
"useTemplate": "warn",
"useWhile": "error"
}
}
}
}noVaruseConstnoNonNullAssertionuseTemplate{
"linter": {
"rules": {
"suspicious": {
"recommended": true,
"noArrayIndexKey": "warn",
"noAssignInExpressions": "error",
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noConsoleLog": "warn",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDoubleEquals": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "warn",
"noExplicitAny": "warn",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noLabelVar": "error",
"noMisleadingCharacterClass": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noSelfCompare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeNegation": "error",
"useDefaultSwitchClauseLast": "error",
"useGetterReturn": "error",
"useValidTypeof": "error"
}
}
}
}noExplicitAnynoConsoleLognoDebuggernoDoubleEqualsnoDuplicateObjectKeys{
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"a11y": { "recommended": true },
"complexity": { "recommended": true },
"correctness": { "recommended": true },
"performance": { "recommended": true },
"security": { "recommended": true },
"style": { "recommended": true },
"suspicious": {
"recommended": true,
"noExplicitAny": "error",
"noConsoleLog": "error"
}
}
}
}{
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "warn",
"noConsoleLog": "warn"
},
"style": {
"noVar": "error",
"useConst": "warn"
}
}
}
}{
"linter": {
"rules": {
"recommended": true,
"a11y": { "recommended": true },
"correctness": {
"recommended": true,
"noChildrenProp": "error"
},
"security": {
"noDangerouslySetInnerHtml": "error"
},
"suspicious": {
"noArrayIndexKey": "error"
}
}
}
}// biome-ignore lint/suspicious/noExplicitAny: Legacy code
function legacyFunction(data: any) {
return data;
}
// biome-ignore lint/suspicious/noConsoleLog: Debug logging
console.log('Debug info');
// Multiple rules
// biome-ignore lint/suspicious/noExplicitAny lint/style/useConst: Migration
var config: any = {};/* biome-ignore-file */
// Legacy file, skip all linting{
"files": {
"ignore": [
"**/generated/**",
"**/*.config.js",
"**/vendor/**"
]
}
}"recommended": truebiome ci{
"extends": ["@company/biome-config"],
"linter": {
"rules": {
"suspicious": {
"noConsoleLog": "error"
}
}
}
}{
"overrides": [
{
"include": ["src/**/*.ts"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "error"
}
}
}
},
{
"include": ["scripts/**/*.js"],
"linter": {
"rules": {
"suspicious": {
"noConsoleLog": "off"
}
}
}
}
]
}npm install -D @biomejs/biomenpx biome initnpx biome check .npx biome check --write .{
"scripts": {
"lint": "biome check .",
"lint:fix": "biome check --write .",
"lint:ci": "biome ci ."
}
}{
"husky": {
"hooks": {
"pre-commit": "biome check --write --changed"
}
}
}- name: Run Biome
run: npx biome ci .