Skip to content

fix(format): stop Prettier reformatting the issue templates - #24

Merged
Bccorb merged 1 commit into
mainfrom
fix/exclude-issue-templates-from-prettier
Jul 31, 2026
Merged

fix(format): stop Prettier reformatting the issue templates#24
Bccorb merged 1 commit into
mainfrom
fix/exclude-issue-templates-from-prettier

Conversation

@Bccorb

@Bccorb Bccorb commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

prettier --check . fails on main today, against two files nothing has touched since #22.

What broke, and why it is not a code change

prettier is ranged at ^3.8.1 and 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:

-export const ExampleSchema = z.object({
-  /* ... */
-});
+export const ExampleSchema = z.object({/* ... */});

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 prettier to 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.

`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).
@Bccorb
Bccorb merged commit 7ca3f4c into main Jul 31, 2026
1 check passed
@Bccorb
Bccorb deleted the fix/exclude-issue-templates-from-prettier branch July 31, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant