Vite Plugin Biome

March 6, 2026 ยท View on GitHub

Run Biome 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

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

Usage

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

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.

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.

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.

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.

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.

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

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

Options

OptionDescriptionValuesDefault
modeThe Biome command to runlint, format, checklint
filesFile or glob pattern to processe.g. 'src/**/*.js''.'
hotUpdateModeHow 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, changedfull
applyFixesApply Biome fixes automaticallytrue, falsefalse
unsafeAllow unsafe fixes, requires applyFixestrue, falsefalse
failOnErrorFail the build when Biome returns errorstrue, falsefalse
forceColorForce color output by adding --colors=forcetrue, falsetrue
diagnosticLevelMinimum diagnostic level to showinfo, warn, errorinfo
logKindOutput style for Biome logspretty, compact, checkpretty
biomeCommandBaseOverride the command used to invoke Biomee.g. 'npx @biomejs/biome'Auto-resolved
biomeAdditionalArgsAdditional CLI arguments passed to Biomee.g. '--changed --config-path=...'โ€”

License

MIT LICENSE

If this plugin saves you time, consider starring the repo: GitHub