Skip to content

chore(lint): make Markdown Prettier-safe and re-enable it (stage one: no line wrapping)#129

Open
taminomara wants to merge 1 commit into
testdouble:mainfrom
taminomara:chore/reenable-prettier-markdown
Open

chore(lint): make Markdown Prettier-safe and re-enable it (stage one: no line wrapping)#129
taminomara wants to merge 1 commit into
testdouble:mainfrom
taminomara:chore/reenable-prettier-markdown

Conversation

@taminomara

@taminomara taminomara commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What

Re-enables Prettier over Markdown (disabled in #127), after making the source robust to the two CommonMark normalizations Prettier cannot turn off.

This PR re-enables prettier, but doesn't enable line wrap to keep initial diff small and easily review-able. I'll send line wrap as a separate PR.

Why

#127 took Markdown out of Prettier's scope because running it corrupted files that agents read as raw source. Two of Prettier's normalizations are core CommonMark rules that survive every config — ordered-list renumbering and inline-code-span trimming. Rather than try to configure them away (impossible), this makes the source robust to them, so Prettier formats this repo's Markdown without changing what any file says.

What's in this PR

Config

  • .prettierrc.json: proseWrap: "preserve" (no paragraph reflow, so the eventual reformat stays small) and embeddedLanguageFormatting: "off" (leave fenced code examples alone).
  • .prettierignore: stop excluding *.md; ignore the schematic html-summary/references/html-template.html that Prettier hard-errors on.
  • .pre-commit-config.yaml: update the stale comment that said Markdown was excluded.

Content made robust to the two un-disable-able normalizations

  • coding-standard: fix the Step 5 list numbering (1,2,4,51,2,3,4).
  • project-documentation, plan-a-feature: give the ordered lists that a lead-in sentence interrupts a valid start, so Prettier keeps them as lists instead of collapsing them into a run-on paragraph.
  • work-item / issue templates: drop the ` — ` code span from the prose (the em-dash heading format is already shown in the template above) and keep the "em-dash with surrounding spaces" wording.
  • overview-template, script-execution-instructions, writing-effective-instructions: use 4-backtick fences around Markdown examples that nest a fence, so the inner fence no longer closes the outer block early (these render broken today).
  • readability-editor, markdown-to-confluence, project-documentation: reword inline code spans Prettier would re-delimit.
  • context-injection-commands: drop redundant padding spaces inside a double-backtick code span.

Sequencing / CI

This PR re-enables Prettier on Markdown but deliberately does not include the mechanical, repo-wide reformat — that rides in a separate PR to keep this one reviewable. As a result, the lint job is expected to be red on this branch until the reformat lands. Intended to be stacked with / merged alongside the reformat PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AhopKKK5YVPzmkdAzHtPcG

PR testdouble#127 took Markdown out of Prettier's scope because running it corrupted
files that agents read as raw source. Two of Prettier's normalizations are
core CommonMark rules that cannot be turned off (ordered-list renumbering and
inline-code-span trimming), so the fix is to make the source robust to them
rather than to configure them away. With that done, Prettier formats this
repo's Markdown without changing what any file says.

Config:
- .prettierrc.json: proseWrap "preserve" (no paragraph reflow, so the reformat
  stays small) and embeddedLanguageFormatting "off" (leave fenced code alone).
- .prettierignore: stop excluding *.md; ignore the schematic html-template.html
  that Prettier hard-errors on (the prek hook never hands it over, but a direct
  `prettier .` would).
- .pre-commit-config.yaml: update the stale comment that said Markdown is
  excluded.

Content made robust to the two un-disable-able normalizations:
- coding-standard: fix the Step 5 list numbering (1,2,4,5 -> 1,2,3,4).
- project-documentation, plan-a-feature: give the ordered lists that a lead-in
  sentence interrupts a valid start, so Prettier keeps them as lists instead of
  collapsing them into a run-on paragraph.
- work-item / issue templates: drop the ` — ` code span from the prose (the
  em-dash heading format is already shown in the template above) and keep the
  "em-dash with surrounding spaces" wording.
- overview-template, script-execution-instructions, writing-effective-
  instructions: 4-backtick fences around Markdown examples that nest a fence, so
  the inner fence no longer closes the outer block early.
- readability-editor, markdown-to-confluence, project-documentation: reword
  inline code spans Prettier would re-delimit.
- context-injection-commands: drop the redundant padding spaces inside a
  double-backtick code span (they do not render, and Prettier strips them).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AhopKKK5YVPzmkdAzHtPcG
@taminomara taminomara changed the title chore(lint): make Markdown Prettier-safe and re-enable it chore(lint): make Markdown Prettier-safe and re-enable it (stage one: no line wrapping) Jul 14, 2026
@taminomara taminomara marked this pull request as ready for review July 14, 2026 23:31
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