chore: add a formatter - #27
Merged
Merged
Conversation
singleQuote=true was chosen by counting this repo's own imports, not by fleet decree. The fleet is genuinely split and the two repos that already had a .prettierrc disagreed with each other, so there was no standard to restore. Quote style does not cross repo boundaries; having a gate does. Markdown is ignored for now — prettier rewraps prose, which would bury the real diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Mechanical. No behaviour change. This SHA is listed in .git-blame-ignore-revs so `git blame` skips it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
eslint-disable-next-line binds to a line number, so reformatting can silently
break it. This effect was written on one line:
// eslint-disable-next-line react-hooks/set-state-in-effect
useEffect(() => { setMounted(true); }, []);
prettier expanded it to a block body, which moved setMounted(true) down a line
and out from under the directive. The rule reports at the setState call, not at
the useEffect, so the suppression stopped applying and the build failed on a
rule the author had deliberately silenced.
Moving the directive inside the effect binds it to the call itself, where
reflowing cannot separate them. The other six directives in src/ still bind.
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.
3 of 30 repos had any formatter at all. This adds one here, and wires
format:checkintoverifyso it actually gates.Why this repo's own style, and not a fleet standard
There was never a standard to restore. Measured across the fleet: excluding openclaw, ~28k single-quoted imports against ~15k double-quoted — and the two repos that already had a
.prettierrcdisagreed with each other (trailingComma: allvses5,arrowParens: alwaysvsavoid).Forcing one quote style would rewrite every string in roughly half the fleet for no benefit. And by the test this whole exercise runs on — does the choice cross repo boundaries? — quote style does not. Nobody copies a file between repos expecting the quotes to match.
So
singleQuotehere was chosen by counting this repo's own imports. The uniformity that matters is that a gate exists everywhere, not that the gate says the same thing everywhere.What is deliberately out of scope
.prettierignoreturns it on later.Reading the diff
Three commits, on purpose:
.git-blame-ignore-revslisting commit 2Run
git config blame.ignoreRevsFile .git-blame-ignore-revsonce andgit blamewill skip straight past the reformat.🤖 Generated with Claude Code
https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P