fix(format): stop Prettier reformatting the issue templates - #24
Merged
Conversation
`prettier --check .` fails on main against `.github/ISSUE_TEMPLATE/`, without
anything in the repo having changed. Prettier is ranged at ^3.8.1 and now
resolves to 3.9.6, which treats code fences inside markdown differently.
What it wants is worse than what is committed: the multi-line placeholder in
each template collapses to `z.object({/* ... */});`, which is harder to read
than the shape a contributor is meant to copy, and is not how anyone writes it.
These templates are prose that GitHub renders. Nothing compiles them, so
formatting them buys no consistency worth having, and it leaves the check
hostage to how the next Prettier decides to treat embedded code.
Verified with npm run format:check, npm run lint, npm run typecheck, and
npm test (155 passing).
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.
prettier --check .fails onmaintoday, against two files nothing has touched since #22.What broke, and why it is not a code change
prettieris ranged at^3.8.1and now resolves to 3.9.6, which treats code fences inside markdown differently. The check passed when those templates were written and fails now, with the repository unchanged. Any PR opened from here fails CI on files it never touched, which is where this surfaced.Why ignore rather than reformat
What Prettier wants is worse than what is committed:
That is inside a fenced block in an issue template. It is the shape a contributor is meant to copy when reporting a contract change, and the collapsed form is both harder to read and not how anyone writes it. Reformatting to satisfy the check would degrade the template.
These files are prose that GitHub renders into its issue UI. Nothing compiles them, so there is no consistency worth buying here, and leaving them in scope keeps the check hostage to how the next Prettier release decides to treat embedded code.
Scoped to
.github/ISSUE_TEMPLATE/rather than all of.github/, so workflow YAML stays formatted.Worth deciding separately
The root cause is the floating range. A transitive minor bump can fail CI on a PR that changed nothing, which is what happened here. Pinning
prettierto an exact version would make that a deliberate upgrade with a visible diff instead of a surprise. Not done here, since it is a different decision from this one and would reformat on whatever version is chosen. Happy to open it if you want it.Verification
npm run format:check,npm run lint,npm run typecheck,npm test(155 passing) all clean.Unblocks #23.