Skip to content

chore(CI): stop running Prettier over Markdown#127

Merged
mxriverlynn merged 2 commits into
mainfrom
chore/disable-prettier-for-markdown
Jul 14, 2026
Merged

chore(CI): stop running Prettier over Markdown#127
mxriverlynn merged 2 commits into
mainfrom
chore/disable-prettier-for-markdown

Conversation

@mxriverlynn

Copy link
Copy Markdown
Collaborator

Prettier reformat: failure modes

Han's lint job has failed on every branch, including main, since CI landed in #120. The prettier config
(proseWrap: "always", printWidth 120) was added but never actually run against the repo. Applying it touches 281
files (+28,218 / -12,660).

This report categorizes what that reformat actually does, based on the diffs verified against the working tree.

The thing to hold onto: prettier keeps the rendered page the same, but han's markdown is read as raw text by agents.
Three of these categories change the raw text in ways that matter.

# Category Files Harmful? Fixable by config?
1 Harmless reformatting ~271 No n/a
2 Frontmatter re-quoting 103 No (verified) n/a
3 Renumbered steps 1 Yes No
4 Mangled code snippets 9 Yes No
5 Rewritten code examples 3 Yes Yes
6 A file prettier can't read 1 Not in CI n/a

1. Harmless reformatting

Rewraps paragraphs at 120 characters, swaps *word* for _word_, pads out tables, tidies blockquotes. This is most of
the 28k-line diff. The words don't change, so nothing breaks. It just makes every future doc diff noisy.

2. Frontmatter re-quoting

Rewrites the description: field at the top of each skill file from double quotes to single quotes. This one warranted
checking, since that field is what Claude reads to decide when to run a skill. All 103 frontmatter blocks were parsed
before and after with a YAML parser: the values come out identical. Safe.

3. Renumbered steps

Prettier renumbers ordered lists. In han-coding/skills/coding-standard/SKILL.md, step 4 becomes step 3 — but the
sentences around it still say "Step 6" and "Step 7". Those now point at the wrong steps, in a file Claude follows as
instructions. Nothing errors; the skill just quietly does the wrong step. This is the worst one.

Note that .pre-commit-config.yaml lists "ordered-list numbering" as something prettier is meant to own, which is the
direct conflict.

4. Mangled code snippets

Prettier strips the spaces inside ` — `, turning it into `—`. In two work-item templates that snippet is
the heading format, and the sentence next to it still says "em-dash with surrounding spaces." The source now shows the
opposite of what the text says.

It also garbles backticks in docs that explain markdown itself, including readability-editor.md — the doc whose job is
to say "leave code fences byte-for-byte unchanged."

Affected: work-items-to-issues/references/issue-template.md, plan-work-items/references/work-item-template.md,
markdown-to-confluence/SKILL.md, code-overview/references/overview-template.md, han-core/agents/readability-editor.md,
project-documentation/SKILL.md, and three guidance references under han-plugin-builder/.

5. Rewritten code examples

Prettier reaches inside fenced code blocks and restyles the code: collapsing JSON arrays, flipping 'base' to "base",
shifting HTML spacing. Those examples are specs, so restyling them is wrong — but this one turns off with
embeddedLanguageFormatting: "off".

Affected: plugin-json-options.md, html-summary/SKILL.md, html-summary/references/report-style.md.

6. A file prettier can't read

han-reporting/skills/html-summary/references/html-template.html is a schematic sketch, not real HTML, and prettier
hard-errors on it (exit 2). Not a CI problem today, because the prek hook only hands prettier markdown, JSON, YAML, and
JS. It would break if anyone widens that list.

Bottom line

Categories 1 and 2 are just noise. Category 5 has a config switch. Categories 3 and 4 are the blockers, and neither
can be turned off
— both still happen under the safest config available (proseWrap: preserve plus
embeddedLanguageFormatting: off), because they are core CommonMark normalizations.

No prettier setting formats this repo's markdown without breaking it. Recommendation: take markdown out of prettier's
scope and keep it on JSON, YAML, and JS — a clean 10-file diff that turns lint green.

Related

  • PR #126 — fixes the other two lint failures (shellcheck, broken symlink).
    Its lint job is still red on prettier alone, pending this decision.

Prettier's Markdown config landed in #120 but was never applied, so the lint
job has failed on every branch since. Applying it is not a mechanical reformat:
it corrupts instructional content, because agents read skills and reference
files as raw source, and a transform that renders the same can still change
what an agent is told to do.

Two of its transforms cannot be configured away, being core CommonMark
normalizations:

- It renumbers ordered lists. In coding-standard/SKILL.md step 4 becomes
  step 3, while that file's prose still points at "Step 6" and "Step 7".
- It strips the spaces inside inline code spans, so the issue-heading spec
  ` — ` becomes `—` beside prose that still reads "with surrounding spaces".

Both survive proseWrap: preserve and embeddedLanguageFormatting: off, so
Markdown leaves Prettier's scope entirely. Prettier keeps JSON, YAML, and JS,
which is the 10-file reformat here.

The Markdown-only options in .prettierrc.json are now dead and removed, and the
hook comments that claimed Prettier owns Markdown are corrected.
@mxriverlynn

Copy link
Copy Markdown
Collaborator Author

@taminomara unfortunately, the prettier config to manage line length in markdown files isn't going to work. for now, i've disabled the prettier config's editing of markdown files with this PR. see the description for detail on what breaks when trying to run prettier on the current files in this repo

@mxriverlynn mxriverlynn merged commit a90cb09 into main Jul 14, 2026
2 checks passed
@mxriverlynn mxriverlynn deleted the chore/disable-prettier-for-markdown branch July 14, 2026 18:22
@taminomara

Copy link
Copy Markdown
Contributor

Oh no :( Thank you for catching this! I did spot-checks in formatted files, but missed these two.

Renumbered steps

Arguably, that's a bug in the skill itself, and an easily fixable one.

Prettier strips the spaces inside ` — `, turning it into `—`.

Yeah, that's technically a correct CommonMark normalization. We can try and work around it by changing the prose. It seems that all issues are around prose re-explaining what's already in template; we can change it so that it doesn't repeat literal template snippets.

i've disabled the prettier config's editing of markdown files

Arguably, prose reflow was the biggest win. Will you accept a PR that re-enables it if I change wording to fix these issues?

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.

2 participants