chore(lint): make the root lint command non-mutating and site-aware - #18
Open
dchaudhari7177 wants to merge 1 commit into
Open
chore(lint): make the root lint command non-mutating and site-aware#18dchaudhari7177 wants to merge 1 commit into
dchaudhari7177 wants to merge 1 commit into
Conversation
"lint" was `biome check --write .`, so the one command contributors run before opening a PR rewrote their working tree. It also could not check the whole repo: `biome check .` from the root aborts with 'Found a nested root configuration' because site/ carries its own root biome.json. lint now runs the two packages under their own configs: lint -> lint:cli && lint:site (read-only) lint:cli -> biome check <explicit paths> lint:site -> cd site && biome check . lint:fix -> the same two with --write lint:cli passes the root config's own include list as explicit paths rather than '.', which is what keeps Biome from descending into site/ and finding the nested root. Splitting the two also keeps them independent roots, so site/ keeps its own rules instead of being folded into the CLI's. Closes crafter-station#15
|
@dchaudhari7177 is attempting to deploy a commit to the Crafter Station Team on Vercel. A member of the Team first needs to authorize it. |
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.
Closes #15.
What changed
Two notes on the approach:
Why explicit paths in
lint:clirather than.— the nested-root abort happens during Biome's config discovery, so it fires whether or notfiles.includeswould have excludedsite/. Passing the root config's own include list as explicit paths keeps Biome from ever descending intosite/.Why not
biome migrate --write— that's what Biome's own error message suggests, but it would foldsite/into the CLI's root config. The issue asks for both to be checked "using their respective Biome configurations", so I kept them as two independent roots and invoked each.Acceptance
bun run lintis non-mutating--writeon either legmaingit status --shortemptylint:fixI also checked the command actually fails when it should, rather than just passing on a clean tree — dropped a badly formatted
src/_tmp_lintcheck.tsin:bun run lintexits 1,bun run lint:fixexits 0 and rewrites the file. (Removed again; not in the diff.)One thing to know about verifying this on Windows
On a default Windows checkout
bun run lintfails on ~10 files, all␍format diffs — git converted LF to CRLF on checkout and Biome wants LF. It's a checkout artifact, not a repo problem, but it made the "exits zero on a clean checkout" criterion unverifiable in place.I confirmed against a fresh
git -c core.autocrlf=false cloneinstead, and all the numbers above come from that. A.gitattributeswith* text=auto eol=lfwould make the command usable on Windows checkouts too — happy to open a separate issue rather than widen this one.