Biome config for @heybrostudio.
bun(pnpm|npm) add -D @biomejs/biome @heybrostudio/biome-config
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["./node_modules/@heybrostudio/biome-config/biome.json"],
// ...
}
For example:
{
"scripts": {
"lint": "biome lint .",
"lint:fix": "biome lint . --write"
}
}
If you want to apply lint and auto-fix before each commit, you can add the following to package.json
:
{
"simple-git-hooks": {
"pre-commit": "bun lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
}
}
Then install the dependencies:
bun(pnpm|npm) i -D lint-staged simple-git-hooks
Finally, activate the hooks:
bunx(pnpx|npx) simple-git-hooks
Install Biome VS Code Extension
Add the following settings to your .vscode/settings.json
:
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
MIT License © 2024-PRESENT Caven Ding