@heybrostudio/biome-config
v0.0.7
Published
Hey Bro Studio's Biome config preset
Downloads
26
Readme
Usage
Install
bun(pnpm|npm) add -D @biomejs/biome @heybrostudio/biome-config
Add to biome.json
file
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["./node_modules/@heybrostudio/biome-config/biome.json"],
// ...
}
Add script for package.json
For example:
{
"scripts": {
"lint": "biome lint .",
"lint:fix": "biome lint . --write"
}
}
Lint Staged
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
VS Code support (auto fix)
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"
}
}
License
MIT License © 2024-PRESENT Caven Ding