Repository navigation
Conversation
Summary: Extracts the markdown linting React Native uses at Meta into Metro's OSS setup, and fixes the existing issues. - `yarn lint-markdown` runs `markdownlint-cli2` on `docs/*.md`. It runs on GitHub CI (`build-test-and-deploy.yml`), in the internal OSS Metro tests (`test-oss-metro-legocastle.sh`) and in `yarn test`. - `.markdownlint-cli2.jsonc` enables the same rules as React Native's `.markdownlint-cli2.mjs`, e.g. `heading-increment`, `link-fragments` and `no-trailing-punctuation`. React Native's `relative-links` custom rule is not used: it includes the HTML of headings such as `` `unstable_middleware` <div class="label experimental">Experimental</div> `` in their anchors, so it rejects valid links like `./Configuration.md#unstable_middleware-experimental`. Links between pages are checked by the website build (`onBrokenLinks`/`onBrokenAnchors: throw`). Fixes: - `heading-increment`: "Merging Example" in `Configuration.md`, and the top-level sections of `LocalDevelopment.md` and `Troubleshooting.md`, are one level higher. - `no-space-in-code`: the `schemeResolvers` type is a single code span, followed by a link to `CustomResolver`. - `no-trailing-punctuation`: "File extensions are important!" in `PackageExports.md` loses the "!". Heading anchors are unchanged. Changelog: [Internal] Differential Revision: D127663612
Summary: Adds a blank line after each opening `:::note`/`:::info`/`:::caution` and before each closing `:::`. Without them, prettier treats the closing `:::` as part of a preceding list item and indents it, which breaks the admonition. Docusaurus recommends these blank lines when formatting Markdown with prettier. This prepares the docs for formatting with prettier in the next diff. No rendered changes. Changelog: [Internal] Differential Revision: D127668483
|
@vzaidman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D127668483. |
Summary: Adds a blank line after each opening `:::note`/`:::info`/`:::caution` and before each closing `:::`. Without them, prettier treats the closing `:::` as part of a preceding list item and indents it, which breaks the admonition. Docusaurus recommends these blank lines when formatting Markdown with prettier. This prepares the docs for formatting with prettier in the next diff. No rendered changes. Changelog: [Internal] Differential Revision: D127668483
Summary: Adds a blank line after each opening `:::note`/`:::info`/`:::caution` and before each closing `:::`. Without them, prettier treats the closing `:::` as part of a preceding list item and indents it, which breaks the admonition. Docusaurus recommends these blank lines when formatting Markdown with prettier. This prepares the docs for formatting with prettier in the next diff. No rendered changes. Changelog: [Internal] Differential Revision: D127668483
Metro review: Looks goodRisk: low · Commit: This PR adds a blank line after each opening No findings. Verified
Not run: I didn't run a Docusaurus website build to confirm that the rendered output is identical. Blank lines inside admonitions are the documented Docusaurus form, so I don't expect any rendering change. No benchmarks were needed, since only Markdown docs change. Two commands that used shell variables or several chained operations were blocked by the session's no-approval policy, so I reran them in simpler forms. Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call. |
Summary:
Adds a blank line after each opening
:::note/:::info/:::cautionand before each closing:::. Without them, prettier treats the closing:::as part of a preceding list item and indents it, which breaks the admonition. Docusaurus recommends these blank lines when formatting Markdown with prettier.This prepares the docs for formatting with prettier in the next diff. No rendered changes.
Changelog: [Internal]
Differential Revision: D127668483