# vite-plugin-biome

> Run Biome in the Vite dev loop for fast linting, formatting, and checks.

Latest version **1.2.0** (published 2026-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install vite-plugin-biome
pnpm add vite-plugin-biome
yarn add vite-plugin-biome
bun add vite-plugin-biome
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2026-03-06 |
| First published | 2023-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 74 |
| Author | Mikkel Espolin Birkeland |
| Maintainers | skrulling |
| Keywords | biome, biomejs, vite, vite-plugin, linter, linting, formatter, formatting, code-quality, ai-assisted-development |

## Links

- npm: https://www.npmjs.com/package/vite-plugin-biome
- Repository: https://github.com/skrulling/vite-plugin-biome
- Issues: https://github.com/skrulling/vite-plugin-biome/issues
- npm.io page: https://npm.io/package/vite-plugin-biome

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2026-03-06
- 1.1.3 — 2026-02-23
- 1.1.2 — 2026-02-09
- 1.1.1 — 2026-02-06
- 1.1.0 — 2025-12-10
- 1.0.12 — 2024-07-03
- 1.0.11 — 2024-06-27
- 1.0.10 — 2024-06-03
- 1.0.9 — 2024-03-13
- 1.0.8 — 2024-02-01
- 1.0.7 — 2024-01-31
- 1.0.6 — 2024-01-29
- 1.0.5 — 2023-12-27
- 1.0.4 — 2023-12-27
- 1.0.3 — 2023-12-24
- … 3 more at https://npm.io/package/vite-plugin-biome/versions

## README

# Vite Plugin Biome

Run [Biome](https://biomejs.dev/) inside your Vite dev loop.

`vite-plugin-biome` lets you lint, format, or check files with the Biome version already installed in your project. It runs on Vite startup and reacts to hot updates, so feedback shows up while you build instead of in a separate step.

By default, each hot update reruns Biome for the configured `files` scope. If you want faster feedback during development, you can opt into rerunning only the edited files.

## Why Use It

- Keep Biome output inside the normal Vite workflow.
- Run `lint`, `format`, or `check` without wiring extra scripts into your day-to-day loop.
- Apply fixes automatically when you want them.
- Fail the build on Biome errors when you need stricter enforcement.
- Pass through extra Biome CLI args such as `--changed` or `--config-path=...`.

## AI-Assisted Development

This plugin is not AI-specific, but it fits well into AI-assisted workflows with tools like Cursor, Claude Code, Codex, and Windsurf. When generated edits touch many files quickly, keeping Biome in the Vite loop helps surface feedback immediately without changing your existing setup.

## Compatibility

This plugin is compatible with:

- **Biome**: 1.8.0 and higher, including 2.x
- **Vite**: 4.x and higher
- **Node.js**: 16.x and higher

By default, the plugin resolves and runs the `@biomejs/biome` binary installed in your project. If you need to use a different command, override `biomeCommandBase`.

## Installation

```bash
npm install -D vite-plugin-biome @biomejs/biome
```

## Usage

Add the plugin to your `vite.config.js` or `vite.config.ts` file.

```ts
import { defineConfig } from 'vite';
import biomePlugin from 'vite-plugin-biome';

export default defineConfig({
  plugins: [biomePlugin()],
});
```

## Common Setups

### Fast Local Guardrails

Run Biome in `lint` mode during development.

```ts
import { defineConfig } from 'vite';
import biomePlugin from 'vite-plugin-biome';

export default defineConfig({
  plugins: [
    biomePlugin({
      mode: 'lint',
      files: '.',
    }),
  ],
});
```

### Auto-Fix During Development

Run Biome in `check` mode and write fixes back to disk.

```ts
import { defineConfig } from 'vite';
import biomePlugin from 'vite-plugin-biome';

export default defineConfig({
  plugins: [
    biomePlugin({
      mode: 'check',
      files: '.',
      applyFixes: true,
    }),
  ],
});
```

### Recheck Only Edited Files During HMR

Keep the initial startup run broad, but limit hot updates to the files you just edited.

```ts
import { defineConfig } from 'vite';
import biomePlugin from 'vite-plugin-biome';

export default defineConfig({
  plugins: [
    biomePlugin({
      mode: 'check',
      files: 'src',
      hotUpdateMode: 'changed',
    }),
  ],
});
```

### Strict Build Feedback

Fail the build when Biome reports errors.

```ts
import { defineConfig } from 'vite';
import biomePlugin from 'vite-plugin-biome';

export default defineConfig({
  plugins: [
    biomePlugin({
      mode: 'check',
      failOnError: true,
    }),
  ],
});
```

### Pass Extra Biome Arguments

Forward additional CLI args to Biome.

```ts
import { defineConfig } from 'vite';
import biomePlugin from 'vite-plugin-biome';

export default defineConfig({
  plugins: [
    biomePlugin({
      mode: 'check',
      biomeAdditionalArgs: '--changed',
    }),
  ],
});
```

## Options

| Option | Description | Values | Default |
|---|---|---|---|
| `mode` | The Biome command to run | `lint`, `format`, `check` | `lint` |
| `files` | File or glob pattern to process | e.g. `'src/**/*.js'` | `'.'` |
| `hotUpdateMode` | How Vite hot updates trigger Biome. `full` reruns the configured scope on every change. `changed` reruns only edited files when possible, with a full fallback for Biome config changes. Startup still runs against the configured scope. | `full`, `changed` | `full` |
| `applyFixes` | Apply Biome fixes automatically | `true`, `false` | `false` |
| `unsafe` | Allow unsafe fixes, requires `applyFixes` | `true`, `false` | `false` |
| `failOnError` | Fail the build when Biome returns errors | `true`, `false` | `false` |
| `forceColor` | Force color output by adding `--colors=force` | `true`, `false` | `true` |
| `diagnosticLevel` | Minimum diagnostic level to show | `info`, `warn`, `error` | `info` |
| `logKind` | Output style for Biome logs | `pretty`, `compact`, `check` | `pretty` |
| `biomeCommandBase` | Override the command used to invoke Biome | e.g. `'npx @biomejs/biome'` | Auto-resolved |
| `biomeAdditionalArgs` | Additional CLI arguments passed to Biome | e.g. `'--changed --config-path=...'` | — |

## License

[MIT LICENSE](LICENSE)

If this plugin saves you time, consider starring the repo:
[GitHub](https://github.com/skrulling/vite-plugin-biome)

---
_Source: https://npm.io/package/vite-plugin-biome · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
