Biome.js config
Here are my Biome.js configs from newest to oldest.
Installation
Install biome as development dependency.
pnpm add -D -E @biomejs/biome
Biome v2
{
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"enabled": true,
"indentStyle": "tab",
"indentWidth": 2,
"lineWidth": 90,
"includes": ["src/**"]
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
"quoteStyle": "double",
"jsxQuoteStyle": "double",
"bracketSameLine": false,
"bracketSpacing": true,
"semicolons": "asNeeded",
"trailingCommas": "none"
}
},
"json": {
"formatter": {
"indentStyle": "tab"
}
},
"linter": {
"enabled": true,
"includes": ["src/**", "!.next/**", "!src/ui/**"],
"rules": {
"recommended": true,
"correctness": {
"noUnusedImports": {
"level": "warn",
"fix": "safe"
},
"noUnusedVariables": "warn",
"noUnsafeOptionalChaining": "error",
"noUnsafeFinally": "error"
},
"nursery": {
"useUniqueElementIds": "off",
"useSortedClasses": {
"level": "warn",
"fix": "safe",
"options": {
"attributes": ["className"],
"functions": ["cn", "clsx", "twMerge"]
}
}
}
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": {
"level": "on",
"options": {
"groups": [
":BLANK_LINE:",
":NODE:",
"./node_modules/**",
":PACKAGE:",
":BLANK_LINE:",
[
"./**",
"@/**",
"@/lib/**",
"@/utils/**",
"@/config",
"!@/components/**",
"!@/modules/**"
],
":BLANK_LINE:",
["@/components/**", "@/modules/**"]
]
}
}
}
}
}
}
Biome v1
{
"$schema": "https://biomejs.dev/schemas/1.0.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"enabled": true,
"indentStyle": "tab",
"indentWidth": 2,
"lineWidth": 90,
"ignore": ["node_modules", ".next", "dist", ".nuxt", ".wrangler", ".react-email"]
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
"quoteStyle": "double",
"jsxQuoteStyle": "double",
"bracketSameLine": false,
"bracketSpacing": true,
"semicolons": "asNeeded",
"trailingCommas": "none"
}
},
"json": {
"formatter": {
"indentStyle": "tab"
}
},
"linter": {
"enable": true,
"rules": {
"recommended": true,
"correctness": {
"noUnusedImports": "warn",
"noUnusedVariables": "warn",
"noUnsafeOptionalChaining": "error",
"noUnsafeFinally": "error"
},
"nursery": {
"useSortedClasses": {
"level": "warn",
"fix": "safe",
"options": {
"attributes": ["className"],
"functions": ["cn", "clsx", "twMerge"]
}
}
}
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}