vite-plugin-biome (v1.2.0) integrates Biome linting, formatting, and checking into the Vite dev server loop. It runs on startup and on hot module replacements, providing immediate feedback during development without separate CLI steps. Supports Biome >=1.8.0 and Vite >=4.x. Key differentiators: automatic fix application, configurable hot update modes (full or changed-only), build-fail-on-error, and extra Biome CLI argument passthrough. Ships TypeScript types.
npm install vite-plugin-biomeVerified import paths — ran on the pinned version, not inferred.
Minimal Vite config enabling Biome check with auto-fix on all source files during dev.
Use `import biomePlugin from 'vite-plugin-biome'`.
Use dynamic `import()` or switch to ESM in your project (e.g., type: 'module' in package.json).
Install @biomejs/biome@^1.8.0 as a devDependency.
Use `failOnError: true` only for production builds (e.g., VITE_BUILD_MODE env check) to avoid blocking dev server.
Accept startup behavior; if you need to avoid startup scan, configure `files` selectively (e.g., `files: 'src'`).
Use `import biomePlugin from 'vite-plugin-biome'` (ESM) or dynamic `import()` in CJS: `const biomePlugin = (await import('vite-plugin-biome')).default;`Use `import biomePlugin from 'vite-plugin-biome'` (default import).
Run `npm install -D @biomejs/biome` or `yarn add -D @biomejs/biome`.
Check Biome config (e.g., `biome.json`) for invalid rules or file exclusions. Run `npx biome format --write .` to test standalone.
Upgrade @biomejs/biome to >=1.9.0 or remove `--changed` from `biomeAdditionalArgs`.