Formatting & Linting
Learn how to format and lint your codebase using Biome.
The starter kit uses Biome for formatting and linting. Biome is a fast formatter and linter written in Rust that combines the functionality of ESLint and Prettier in one tool.
Why choose Biome? Biome is a fast formatter and linter written in Rust. It provides excellent performance, combines formatting and linting in one tool and has built-in support for TypeScript, JavaScript and JSON.
Auto-format and fix code on save
By default, Biome is configured to format and lint the codebase while you are developing.
If you want to disable this behavior, open the .vscode/settings.json file and set the following options:
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"quickfix.biome": "never",
"source.organizeImports.biome": "never"
}
}Manual formatting and linting
To manually format your codebase run:
npm run formatTo manually lint your codebase run:
npm run lintTo fix all the linting errors in your codebase run:
npm run lint:writeAlternatively, you can use the check command which formats and lints together:
npm run check:writeConfiguration
Biome configuration is in biome.json. This file contains both formatting and linting rules.
Editor Integration
For the best experience, we recommend:
- VS Code: Install the Biome extension
- Format on Save: Enable format on save in your editor settings
- Auto-fix on Save: Configure Biome to auto-fix on save
Pre-commit Hooks
The project uses Husky to run Biome checks before commits. This ensures code quality and formatting consistency are maintained.