Demo
General
Codebase

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.

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:

.vscode/settings.json
{
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "quickfix.biome": "never",
    "source.organizeImports.biome": "never"
  }
}

Manual formatting and linting

To manually format your codebase run:

Terminal
npm run format

To manually lint your codebase run:

Terminal
npm run lint

To fix all the linting errors in your codebase run:

Terminal
npm run lint:write

Alternatively, you can use the check command which formats and lints together:

Terminal
npm run check:write

Configuration

Biome configuration is in biome.json. This file contains both formatting and linting rules.

Editor Integration

For the best experience, we recommend:

  1. VS Code: Install the Biome extension
  2. Format on Save: Enable format on save in your editor settings
  3. 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.