Skip to content

Add Prettier auto-formatting for docs content, and remove docs-lint-markdown #1623

Description

@alexandratran

Context

Prettier is already configured in this repo (.prettierrc, format script, lint-staged block) but never enforced — there's no .husky/prepare script wiring it to git hooks, and CI's docs-lint-all step only lints .js/.ts/.jsx/.tsx (ESLint) and .css (Stylelint); eslint.config.mjs explicitly ignores .md/.mdx/.json. So doc content has zero formatting enforcement today.

Separately, lint.yml's docs-lint-markdown step is currently a no-op: it defaults to checking docs/**/*.md, but docs/ has 294 .mdx files and zero .md files, so it never matches anything and silently passes without checking content.

Proposal

  1. Add a Prettier CI check scoped to changed files only (see metamask-docs's ci.yml prettier job for the pattern).
  2. Wire up .husky + prepare so lint-staged actually runs pre-commit locally.
  3. Remove the docs-lint-markdown step from lint.yml.
  4. Review and update .prettierrc for docs before turning any of this on — proseWrap and printWidth in particular will almost certainly need to change from their current defaults (always / 80) to match how Linea docs are actually written, or the first run will force a massive rewrap diff across nearly every page.

Notes

  • Needs its own investigation into the right Prettier config for this content (proseWrap, printWidth, frontmatter quote style, MDX-specific quirks) — don't assume current .prettierrc values are right for docs.
  • Decide file-type scope for the new CI check (at minimum .md/.mdx; avoid re-checking .js/.ts/.jsx/.tsx/.css, already covered by existing ESLint/Stylelint).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions