Repository navigation
chore(format): establish and enforce a prettier baseline - #23
Merged
Merged
Conversation
Set printWidth to 120, add a non-mutating format:check script and run it in CI, and make the pre-commit hook format staged TypeScript files. Align the contribution guide with the configuration.
1 task done
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.
PR Type
What is the current behavior?
Prettier is a dev dependency, but nothing runs it: 50 of 68 TypeScript files fail
prettier --check, CI has no format step, the lint-staged task list is empty, and the contribution guide asks for 100-character lines while.prettierrcuses the default 80.Closes #22.
What is the new behavior?
.prettierrcsetsprintWidth: 120. That is closest to how the code is already written: 120 changes 39 files, against 44 at 100 and 50 at 80, and it produced roughly half the diff of 100 in line count.npm run format:check(non-mutating) runs in the CIbuildjob after lint.*.tsfiles through lint-staged.CONTRIBUTING.mddocuments the 120-character width and the format commands, replacing the staleDEVELOPER.md#clang-formatlink..git-blame-ignore-revslists it, sogit blameskips it (GitHub applies this automatically; locally rungit config blame.ignoreRevsFile .git-blame-ignore-revs).Please merge with a merge commit, not a squash, so the commit SHA in
.git-blame-ignore-revsstays valid.Does this PR introduce a breaking change?
Other information
Format check, build, lint, typecheck and the full test suite pass locally (900 passed, 16 skipped).
Open PRs touching
.tsfiles will conflict after this lands. Resolve by taking their side and runningnpm run format.