feat: add a biome check - #329
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
alexander-akait
force-pushed
the
feat/biome-check
branch
from
September 11, 2026 10:39
a07f4cb to
088ea7f
Compare
Run it with `{ use: "biome" }`. It checks the files webpack builds and
reports at Biome's own severities, `command: "check"` adding Biome's
formatting diagnostics to the linter's. Biome calls the JSON reporter this
reads experimental, which is said where the flag is passed and in the README:
it is the only reporter carrying the severities a check needs.
Biome and oxlint are both a binary behind a Node entry rather than a library,
so what the two of them need is `src/cli.js` now rather than a copy each:
finding the binary, running it for JSON, grouping a tool's diagnostics by the
file they were found in, and splitting them by the severity the tool gave
them. oxlint moves onto it here.
Three things a new suite needs that only one of them was being given. Its
fixtures belong in `.prettierignore` as well as the lint ignores — `lint:prettier`
is `prettier -w`, so running the suite's own lint reformatted the deliberately
misformatted fixture the `check` case rests on — and its `outputs` belong in
`.gitignore`, without which a build artifact is committed and rewritten by
every run. The artifacts the typescript and oxlint suites left behind are
dropped, and both suites' fixtures and outputs are listed alongside biome's.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
alexander-akait
force-pushed
the
feat/biome-check
branch
from
September 11, 2026 10:40
088ea7f to
5006567
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The fifth check, and the last one the equivalent plugins for other bundlers have that this did not. Run it with
{ use: "biome" }: it checks the files webpack builds and reports at Biome's own severities, withcommand: "check"adding Biome's formatting and assist diagnostics to the linter's.Biome is not outdated or deprecated, which is worth recording since it was asked:
@biomejs/biome2.5.13 published the day before this PR, 105 stable releases, no deprecation. (Download figures I could not get —api.npmjs.orgis unreachable from here — so I am claiming nothing about popularity.)Biome and oxlint are the same shape, a binary behind a Node entry rather than a library, so what the two of them need is
src/cli.jsrather than a copy each: finding the binary, running it for JSON, grouping diagnostics by the file they were found in, and splitting them by the severity the tool gave them. oxlint moves onto it here, so this adds a check and removes the duplication that adding it would otherwise have created.Biome calls the JSON reporter this reads experimental — a release of its own may move the shape. That is said where the flag is passed and in the README, and it is the only reporter carrying the severities a check needs.
Three things a new test suite needs that only one of them was being given, each found by it going wrong:
.prettierignore.lint:prettierisprettier -w, so running the suite's own lint reformatted the deliberately misformatted fixture thecheckcase rests on, and the case then proved nothing..gitignoreforoutputs. Without it a build artifact is committed and rewritten by every run —test/typescript/outputs/main.jsis onmainnow from feat: add a typescript check #327, andtest/oxlint/outputs/main.jswas in feat: add an oxlint check #328. Both are dropped here and all three suites listed.fixtures/package.jsonwith"type": "commonjs", orrequire()in a fixture is not a dependency webpack follows, since the repository itself is"type": "module".What kind of change does this PR introduce?
feat
Did you add tests for your changes?
Yes —
test/biome/biome.test.js, ten cases: a clean project reports nothing; an"error"rule becomes a webpack error naming file, line, column and rule; a"warn"rule becomes a warning without carrying the error; two problems in one file both survive;reportAsmoves both; the linter alone runs by default over a misformatted file and says nothing;command: "check"reports that file's formatting; a formatter written in the configuration is used; Biome refusing to run is reported; and abiomePathnaming nothing is reported. The oxlint suite still passes unchanged against the shared plumbing.Does this PR introduce a breaking change?
No. The check is opt-in, and
src/cli.jsis internal — the oxlint check behaves as before.If relevant, what needs to be documented once your changes are merged or what have you already documented?
README.mdhere: aBiomesection withbiomePath,command,configFileandargs, plus the intro and install lines.@biomejs/biome >= 2is an optional peer. The webpack.js.org page wants the section after release.Use of AI
AI was used. Claude Code installed Biome and probed its CLI before designing anything — which is how the JSON-on-stdout, notice-on-stderr split, the relative
location.path, the lowercase severities and the non-zero exit are described from what it prints rather than from memory. It had also argued against adding Biome at all, on the grounds that it duplicates oxlint's kind of check; told to add it, it did, and took the opportunity to share the plumbing. It verified that neitherbiome checknor the check through the plugin writes to a source file before trusting the fixture that appeared to have been rewritten.🤖 Generated with Claude Code
https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
Generated by Claude Code