Skip to content

chore(lint): no gate checks Markdown formatting, so every docs edit carries reflow noise #468

Backlog

Description

@sydevs-bot

Summary

prettier/prettier is the repo's only formatting gate, and eslint.config.js:56 scopes its block to files: ['**/*.{js,jsx,ts,tsx}']. Markdown is therefore outside every gate: pnpm lint ignores it, there is no format or format:check script in package.json, and .github/workflows/ci.yml runs neither. .prettierrc still applies to .md whenever anything runs prettier over it, so main's Markdown has drifted from it and the backlog lands in whichever PR next touches a doc.

Measured on #467, a nine-file rename: 52 of its 118 changed lines are prettier reformatting Markdown the rename never touched — 44 in docs/testing.md (table re-alignment, *em* → _em_, one inserted blank line), 8 in AGENTS.md. The rename itself is about 15 lines. That noise is paid again on every docs PR, and it hides the real change from a reviewer reading the diff.

Approach

  • Decide the rule first: either bring .md under the gate, or take it out of prettier's scope. Half-covered is what produces the drift.
  • To gate it, add a format:check script (prettier --check .) and a format script beside it, then add the check to the gate job in .github/workflows/ci.yml. Do not widen eslint.config.js:56 — eslint has no Markdown parser configured, and .claude/** is already in its ignores at line 41.
  • ⚠ The lean gate .claude/skills/pr-prep/check.sh is under .claude/, a Protected Path an unattended run cannot write. Either leave the lean gate alone and gate only in CI, or hand that one edit to an attended run.
  • A first prettier --write over the existing Markdown is one large formatting-only commit. Keep it as its own commit so later git blame on a doc line stays readable.
  • Check .prettierignore (currently only src/types/payload/) for docs that must not be reformatted. src/mocks/regions.ts's 27 // prettier-ignore lines are the known precedent for format runs doing damage (docs/rules/code-comments.md).

Acceptance criteria

  • pnpm lint or a new format:check script fails on a Markdown file that does not match .prettierrc, and that check runs in CI on a pull request.
  • Every tracked .md file in the repo passes it on main.
  • A PR that edits one line of a doc shows one changed line.

Verification checklist

  • npx prettier --check . passes from a clean main checkout after the sweep.
  • Introduce an unformatted Markdown table in a scratch commit and confirm the gate goes red.
  • Confirm the gate's check name is one the main ruleset requires, or say in the PR that the ruleset edit is an attended browser step (docs/testing.md § the required-checks table).

Notes

Found while reviewing #467. Not a defect in that PR — it only exposed the drift.

🤖 Written by the sydevs autonomous loop — see what this is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposal

    Type

    Fields

    Priority

    Low

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions