@codacy/tools-biome-2
v0.3.4
Published
Biome adapter — CLI-mode JavaScript/TypeScript/CSS/JSON linter
Downloads
576
Readme
@codacy/tools-biome-2
Table of Contents
Overview
JavaScript/TypeScript/CSS/JSON linter using the Biome binary. Biome is a fast web toolchain written in Rust that provides linting, formatting, and import sorting. Uses the CLI execution strategy with the binary bundled as an npm dependency.
| Property | Value |
| ------------- | --------------------------------------------------------------------- |
| Tool ID | Biome |
| Codacy UUID | 934a97f8-835c-42fc-a6d1-02bdfca3bdfa |
| Strategy | CLI (bundled via npm) |
| Languages | JavaScript, TypeScript, JSX, TSX, JSON, CSS |
| Binary | @biomejs/biome npm package |
| File patterns | **/*.js, **/*.jsx, **/*.ts, **/*.tsx, **/*.json, **/*.css |
| Pattern count | ~466 |
Updating patterns
# Re-fetch pattern metadata from the Codacy API
pnpm prefetch
# Commit the result
git add src/patterns.jsonPattern IDs follow the format Biome_lint_suspicious_noDoubleEquals, Biome_lint_correctness_noUnusedVariables, etc.
Updating the Biome version
- Update
preferredVersioninsrc/adapter.ts - Update the
@biomejs/biomedependency version inpackage.json - Run
pnpm installto get the new binary - Run
pnpm prefetch— Biome adds new rules frequently - Run
pnpm testto verify compatibility - If the major version changes, create a new adapter package (
biome-3/)
Development
pnpm build # Build with tsup
pnpm test # Run tests (biome is bundled, no external install needed)Notes for maintainers
- Biome is a standalone Rust binary distributed via the
@biomejs/biomenpm package with platform-specific optionalDependencies (@biomejs/cli-darwin-arm64,@biomejs/cli-linux-x64, etc.). - The adapter resolves the binary from
@biomejs/biome/bin/biome(a JS wrapper) and invokes it vianode. - JSON output via
biome lint --reporter=json— the JSON is emitted to stdout, while stderr contains an unstable API warning (filtered by the adapter). - Exit code 0 = clean, 1 = issues found (normal), 2+ = error.
--config-pathaccepts a directory path (biome looks forbiome.jsoninside it).- Critical gotcha: The generated
biome.jsonmust be written to a temp directory outside the repository. Biome 2.x treats anybiome.jsoninside the repo hierarchy as a nested root configuration and errors out with "Found a nested root configuration" if there is already an implicit root at the repo level. Writing toos.tmpdir()avoids this. - When patterns are specified, a
biome.jsonconfig is generated withrecommended: falseand only the requested rules enabled. - Config file search order:
biome.json,biome.jsonc,.biome.json,.biome.jsonc. - Biome reports 1-based line and column numbers — no conversion needed.
- File paths in JSON output are relative to the working directory.
