Skip to content

chore: lint markdown with markdownlint - #87

Merged
viceice merged 1 commit into
mainfrom
viceice/markdownlint
Dec 2, 2026
Merged

viceice merged 1 commit into
mainfrom
viceice/markdownlint

Conversation

@viceice

@viceice viceice commented Dec 2, 2026

Copy link
Copy Markdown
Member

Changes

  • Lint markdown with markdownlint-cli2, with the config from containerbase/base.
  • Add lint:markdown to pnpm lint and CI, and fix staged markdown files in the commit hook.
  • Add markdownlint as a peer dependency, so editor integrations such as the VS Code extension resolve the config's extends.

Context

Please select one of the following:

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Use of AI in replying to PR comments

Who answers review comments:

  • @viceice will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted. Name the account.
  • An agent will draft replies and reply autonomously. This is heavily discouraged, and we prefer that there are humans in the loop
  • Nobody has explicitly committed to replying.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified tests

Drafted by Claude Code (Claude Opus 5.5, low effort) on behalf of @viceice.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
@qodo-code-review

qodo-code-review Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Lint markdown with markdownlint-cli2 across scripts, CI, and hooks

⚙️ Configuration changes ✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Adds markdownlint-cli2 with a shared containerbase-style config, enforced via pnpm lint.
• Runs markdown lint in CI and auto-fixes staged *.md files in the lint-staged pre-commit hook.
• Adds markdownlint as a peer dependency so editors resolve the config's extends.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 0 capabilities

  • No production behavior changes identified.
Behavioral complexity 🟢 Low 🧩 Assessed behavior

  • No production behavior changes identified.
Potential damage 🟢 Low 🩹 Assessed behavior

  • No production behavior changes identified.
Assessed commit 1d974e1
Diagram

graph TD
  A["CI build.yml"] --> B["pnpm lint:markdown"] --> C["markdownlint-cli2"]
  D["Husky pre-commit"] --> E["lint-staged *.md"] --> C
  C --> F[".markdownlint-cli2.jsonc"] --> G["markdownlint/style/prettier"]
  H["package.json peerDeps"] --> G
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Rely on oxfmt for markdown only
  • ➕ No new dependency or config file
  • ➕ Single formatter already in use
  • ➖ Does not enforce markdown rules such as heading structure or list style
  • ➖ Does not match the containerbase standard used elsewhere
2. Use legacy markdownlint-cli (v1)
  • ➕ Widely documented
  • ➕ Same underlying markdownlint rules
  • ➖ Superseded by markdownlint-cli2 with a faster runner and better glob and config handling
  • ➖ Less active maintenance

Recommendation: The PR's approach is reasonable: markdownlint-cli2 is the maintained CLI, and the containerbase config keeps the rules consistent with sibling repos. The main alternative to weigh is whether oxfmt alone covers enough. oxfmt formats markdown but does not catch structural issues such as heading order, list indentation, or bare URLs, so a dedicated linter is justified. Consider narrowing the peer dependency if this package is not published, since a peer on a dev-only tool is unusual.

Files changed (5) +761 / -3

Other (5) +761 / -3
build.ymlAdd markdown lint step to CI build job +2/-0

Add markdown lint step to CI build job

• Adds a 'pnpm lint:markdown' step after the oxfmt check so markdown violations fail the build. The step runs unconditionally, unlike the shellcheck step, which is skipped for merge_group events.

.github/workflows/build.yml

.lintstagedrc.jsonRoute markdown files through markdownlint before oxfmt +2/-1

Route markdown files through markdownlint before oxfmt

• Splits the catch-all oxfmt glob so '*.md' runs 'markdownlint-cli2 --fix' and then 'oxfmt'. Non-markdown files keep the oxfmt-only behavior through a '!*.md' negation. Staged markdown is auto-fixed rather than rejected.

.lintstagedrc.json

.markdownlint-cli2.jsoncAdd markdownlint-cli2 config extending prettier style +29/-0

Add markdownlint-cli2 config extending prettier style

• New config extends markdownlint/style/prettier and sets 2-space 'ul-indent' with single-space list markers. It disables line-length, first-line-heading, single-h1, no-inline-html, and no-emphasis-as-heading, and relaxes no-duplicate-heading to siblings only. It honors .gitignore and ignores '.claude/**'.

.markdownlint-cli2.jsonc

package.jsonAdd lint:markdown scripts, devDependency, and peer dependency +8/-2

Add lint:markdown scripts, devDependency, and peer dependency

• Adds 'lint:markdown' and 'lint-fix:markdown' scripts and chains them into 'lint' and 'lint-fix'. Adds 'markdownlint-cli2' 0.24.2 as a devDependency and 'markdownlint' as a peer dependency so the config's extends resolves in editors.

package.json

pnpm-lock.yamlLock markdownlint-cli2 and markdownlint transitive dependencies +720/-0

Lock markdownlint-cli2 and markdownlint transitive dependencies

• Adds about 720 lines of resolved packages for markdownlint-cli2 and its transitive dependencies, plus the markdownlint peer. This is generated lockfile content and should be reviewed by spot check, not line by line.

pnpm-lock.yaml

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@viceice
viceice added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 4c87109 Dec 2, 2026
5 checks passed
@viceice
viceice deleted the viceice/markdownlint branch December 2, 2026 08:57
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