Repository navigation
Apply Markdown formatting options through Prettier config - #5882
Merged
Merged
Conversation
lint-staged formatted Markdown with `--tab-width 3 --single-quote true`, so plain `prettier --check` and editors (2-space) disagreed with the pre-commit hook on nested lists, e.g. CHANGELOG.md. Add a `*.md` override with `tabWidth: 3` to the root and the 11 nested `.prettierrc.yml` copies, and let lint-staged run plain `prettier --write` for Markdown. `singleQuote` is already `true` in every config. Formatting output is unchanged for all tracked Markdown files.
Eugene (OEvgeny)
marked this pull request as ready for review
October 17, 2026 03:44
Eugene (OEvgeny)
requested review from
William Wong (compulim),
Chris Whitten (cwhitten) and
TJ Durnford (tdurnford)
as code owners
October 17, 2026 03:44
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The configuration changes consistently replace the hook-specific options, with no blocking issues identified in static review.
No open issues 🎉
What changed in this PR
Aligns Markdown formatting across Prettier, editors, and pre-commit hooks without reformatting Markdown files.
Changes:
- Adds three-space Markdown indentation to all 12 Prettier configurations.
- Reuses the standard lint-staged formatter, removing redundant command-line options.
| File | Description |
|---|---|
| samples/.prettierrc.yml | Adds Markdown indentation override. |
| packages/playground/.prettierrc.yml | Adds Markdown indentation override. |
| packages/isomorphic-react/.prettierrc.yml | Adds Markdown indentation override. |
| packages/isomorphic-react-dom/.prettierrc.yml | Adds Markdown indentation override. |
| packages/fluent-theme/.prettierrc.yml | Adds Markdown indentation override. |
| packages/embed/.prettierrc.yml | Adds Markdown indentation override. |
| packages/directlinespeech/.prettierrc.yml | Adds Markdown indentation override. |
| packages/core/.prettierrc.yml | Adds Markdown indentation override. |
| packages/component/.prettierrc.yml | Adds Markdown indentation override. |
| packages/bundle/.prettierrc.yml | Adds Markdown indentation override. |
| packages/api/.prettierrc.yml | Adds Markdown indentation override. |
| lint-staged.config.js | Uses the shared formatter for Markdown. |
| .prettierrc.yml | Sets repository-wide Markdown indentation. |
Review effort: Balanced
William Wong (compulim)
approved these changes
Oct 17, 2026
Eugene (OEvgeny)
enabled auto-merge (squash)
October 17, 2026 03:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog Entry
Not required, development only.
Description
Markdown uses 3-space indentation, but that rule only lived in
lint-staged.config.js(prettier --write <file> --tab-width 3 --single-quote true). Plain Prettier and editors read.prettierrc.yml, which saystabWidth: 2. Sonpx prettier --check CHANGELOG.mdfails onmain, while the pre-commit hook formats the same file without changes. Contributors and agents repeatedly spent time proving that this failure was "pre-existing" before they could commit.This PR moves the Markdown option into the Prettier config, so Prettier, editors, and the pre-commit hook agree. No Markdown file is reformatted.
Design
.prettierrc.ymlgets anoverridesentry for*.mdwithtabWidth: 3.singleQuoteis alreadytrue, so the second CLI flag was redundant..prettierrc.ymlfiles (samples/and 10 packages) are identical copies of the root config. Prettier uses the nearest config file, so they get the same override. Without it, Markdown files in those folders would still format with 2 spaces under plain Prettier.prettier --writefor Markdown, like it does for code.Formatting output is unchanged. For each of the 137 tracked Markdown files, the old hook command on
mainand plainprettieron this branch produce byte-identical output. The same 49 files passprettier --check, includingCHANGELOG.md.Many Markdown files (85, e.g.
README.md,AGENTS.md, most ofdocs/andsamples/) already fail both the old hook form and plain Prettier, because they predate it or were committed without the hook. This PR leaves them as they are; the hook will format them when they are next edited, as it does today.Specific Changes
Added a
*.mdoverride withtabWidth: 3to.prettierrc.yml,samples/.prettierrc.yml, andpackages/*/.prettierrc.ymllint-staged.config.js: Markdown usesprettierCode, and theprettierMarkdownfunction and its CLI flags are removedI have added tests and executed them locally
I have updated
CHANGELOG.mdI have updated documentation
Review Checklist
z-index)package.jsonandpackage-lock.jsonreviewed