Repository navigation
build: check the formatting of docs code blocks with oxfmt - #54140
Merged
Merged
Conversation
lint-roller 4 splits the old `lint-roller-markdown-standard` into an oxlint half and an oxfmt half. This wires up the second one: `lint:fmt-in-markdown` runs `lint-roller-markdown-oxfmt` over docs/ as part of `lint:docs`, using docs/.oxfmtrc.json, which matches the repo's .oxfmtrc.json except that docs snippets keep their semicolon-free style. `--fix` writes the formatted blocks back, and a block can opt out with `@noformat` in its info string.
Result of `lint-roller-markdown-oxfmt --fix` with docs/.oxfmtrc.json, plus the @ts-expect-error line anchors (and one Docusaurus highlight marker) that moved with the reformat. The Babel output sample in the ESM guide and the two excerpts of repo source in creating-api.md are marked @noformat, and the contentTracing example passes an async callback instead of wrapping an IIFE so that it does not need a leading semicolon.
dsanders11
approved these changes
Sep 21, 2026
|
No Release Notes |
This was referenced Sep 21, 2026
Merged
Merged
Merged
Contributor
|
@MarshallOfSound has manually backported this PR to "45-x-y", please check out #54157 |
Contributor
|
@MarshallOfSound has manually backported this PR to "44-x-y", please check out #54158 |
Contributor
|
@MarshallOfSound has manually backported this PR to "43-x-y", please check out #54159 |
Contributor
|
@MarshallOfSound has manually backported this PR to "42-x-y", please check out #54160 |
MarshallOfSound
added a commit
that referenced
this pull request
Sep 21, 2026
…ks with oxfmt (45-x-y) (#54157) * build(deps-dev): bump oxlint from 1.57.0 to 1.80.0 (#53431) * build(deps-dev): bump oxlint from 1.57.0 to 1.80.0 Bumps [oxlint](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint) from 1.57.0 to 1.80.0. - [Release notes](https://github.com/oxc-project/oxc/releases) - [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxlint/CHANGELOG.md) - [Commits](https://github.com/oxc-project/oxc/commits/oxlint_v1.80.0/npm/oxlint) --- updated-dependencies: - dependency-name: oxlint dependency-version: 1.80.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * chore: satisfy lint rule --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Sanders <[email protected]> (cherry picked from commit 633785d) * build: update @electron/lint-roller to 4.0.0 (#54139) lint-roller 4 drops `lint-roller-markdown-standard` (and with it the transitive eslint/standard dependency tree, roughly 1,900 lines of yarn.lock) in favour of `lint-roller-markdown-oxlint`, which lints the JS code blocks in docs/ with the repo's own oxlint and .oxlintrc.json. It also makes `lint-roller-markdown-ts-check` work with TypeScript 6 and 7. - `lint:js-in-markdown` now runs `lint-roller-markdown-oxlint`. - `lint:docs-fiddles` ran the `standard` binary, which was only ever installed as a dependency of lint-roller 3, so it now runs oxlint over docs/fiddles instead. The dozen findings that surfaced (unused trailing callback parameters, one `require('path')`, one stale eslint-disable comment) are fixed in the fiddles, and the one tutorial that inlines an affected fiddle is kept in sync. - The `<!-- eslint-... -->` HTML comments in docs were directives for lint-roller-markdown-standard and are removed, and the docs style guide no longer points at standard-markdown. Co-authored-by: Claude <[email protected]> (cherry picked from commit 5eefaea) * build: check the formatting of docs code blocks with oxfmt (#54140) * build: check the formatting of docs code blocks with oxfmt lint-roller 4 splits the old `lint-roller-markdown-standard` into an oxlint half and an oxfmt half. This wires up the second one: `lint:fmt-in-markdown` runs `lint-roller-markdown-oxfmt` over docs/ as part of `lint:docs`, using docs/.oxfmtrc.json, which matches the repo's .oxfmtrc.json except that docs snippets keep their semicolon-free style. `--fix` writes the formatted blocks back, and a block can opt out with `@noformat` in its info string. * docs: format code blocks with oxfmt Result of `lint-roller-markdown-oxfmt --fix` with docs/.oxfmtrc.json, plus the @ts-expect-error line anchors (and one Docusaurus highlight marker) that moved with the reformat. The Babel output sample in the ESM guide and the two excerpts of repo source in creating-api.md are marked @noformat, and the contentTracing example passes an async callback instead of wrapping an IIFE so that it does not need a leading semicolon. --------- Co-authored-by: Claude <[email protected]> (cherry picked from commit ad3a896) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Sanders <[email protected]> Co-authored-by: Claude <[email protected]>
MarshallOfSound
added a commit
that referenced
this pull request
Sep 21, 2026
…ks with oxfmt (44-x-y) (#54158) * build(deps-dev): bump oxlint from 1.57.0 to 1.80.0 (#53431) * build(deps-dev): bump oxlint from 1.57.0 to 1.80.0 Bumps [oxlint](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint) from 1.57.0 to 1.80.0. - [Release notes](https://github.com/oxc-project/oxc/releases) - [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxlint/CHANGELOG.md) - [Commits](https://github.com/oxc-project/oxc/commits/oxlint_v1.80.0/npm/oxlint) --- updated-dependencies: - dependency-name: oxlint dependency-version: 1.80.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * chore: satisfy lint rule --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Sanders <[email protected]> (cherry picked from commit 633785d) * build: update @electron/lint-roller to 4.0.0 (#54139) lint-roller 4 drops `lint-roller-markdown-standard` (and with it the transitive eslint/standard dependency tree, roughly 1,900 lines of yarn.lock) in favour of `lint-roller-markdown-oxlint`, which lints the JS code blocks in docs/ with the repo's own oxlint and .oxlintrc.json. It also makes `lint-roller-markdown-ts-check` work with TypeScript 6 and 7. - `lint:js-in-markdown` now runs `lint-roller-markdown-oxlint`. - `lint:docs-fiddles` ran the `standard` binary, which was only ever installed as a dependency of lint-roller 3, so it now runs oxlint over docs/fiddles instead. The dozen findings that surfaced (unused trailing callback parameters, one `require('path')`, one stale eslint-disable comment) are fixed in the fiddles, and the one tutorial that inlines an affected fiddle is kept in sync. - The `<!-- eslint-... -->` HTML comments in docs were directives for lint-roller-markdown-standard and are removed, and the docs style guide no longer points at standard-markdown. Co-authored-by: Claude <[email protected]> (cherry picked from commit 5eefaea) * build: check the formatting of docs code blocks with oxfmt (#54140) * build: check the formatting of docs code blocks with oxfmt lint-roller 4 splits the old `lint-roller-markdown-standard` into an oxlint half and an oxfmt half. This wires up the second one: `lint:fmt-in-markdown` runs `lint-roller-markdown-oxfmt` over docs/ as part of `lint:docs`, using docs/.oxfmtrc.json, which matches the repo's .oxfmtrc.json except that docs snippets keep their semicolon-free style. `--fix` writes the formatted blocks back, and a block can opt out with `@noformat` in its info string. * docs: format code blocks with oxfmt Result of `lint-roller-markdown-oxfmt --fix` with docs/.oxfmtrc.json, plus the @ts-expect-error line anchors (and one Docusaurus highlight marker) that moved with the reformat. The Babel output sample in the ESM guide and the two excerpts of repo source in creating-api.md are marked @noformat, and the contentTracing example passes an async callback instead of wrapping an IIFE so that it does not need a leading semicolon. --------- Co-authored-by: Claude <[email protected]> (cherry picked from commit ad3a896) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Sanders <[email protected]> Co-authored-by: Claude <[email protected]>
MarshallOfSound
added a commit
that referenced
this pull request
Sep 21, 2026
…ks with oxfmt (43-x-y) (#54159) * build(deps-dev): bump oxlint from 1.57.0 to 1.80.0 (#53431) * build(deps-dev): bump oxlint from 1.57.0 to 1.80.0 Bumps [oxlint](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint) from 1.57.0 to 1.80.0. - [Release notes](https://github.com/oxc-project/oxc/releases) - [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxlint/CHANGELOG.md) - [Commits](https://github.com/oxc-project/oxc/commits/oxlint_v1.80.0/npm/oxlint) --- updated-dependencies: - dependency-name: oxlint dependency-version: 1.80.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * chore: satisfy lint rule --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Sanders <[email protected]> (cherry picked from commit 633785d) * build: update @electron/lint-roller to 4.0.0 (#54139) lint-roller 4 drops `lint-roller-markdown-standard` (and with it the transitive eslint/standard dependency tree, roughly 1,900 lines of yarn.lock) in favour of `lint-roller-markdown-oxlint`, which lints the JS code blocks in docs/ with the repo's own oxlint and .oxlintrc.json. It also makes `lint-roller-markdown-ts-check` work with TypeScript 6 and 7. - `lint:js-in-markdown` now runs `lint-roller-markdown-oxlint`. - `lint:docs-fiddles` ran the `standard` binary, which was only ever installed as a dependency of lint-roller 3, so it now runs oxlint over docs/fiddles instead. The dozen findings that surfaced (unused trailing callback parameters, one `require('path')`, one stale eslint-disable comment) are fixed in the fiddles, and the one tutorial that inlines an affected fiddle is kept in sync. - The `<!-- eslint-... -->` HTML comments in docs were directives for lint-roller-markdown-standard and are removed, and the docs style guide no longer points at standard-markdown. Co-authored-by: Claude <[email protected]> (cherry picked from commit 5eefaea) * build: check the formatting of docs code blocks with oxfmt (#54140) * build: check the formatting of docs code blocks with oxfmt lint-roller 4 splits the old `lint-roller-markdown-standard` into an oxlint half and an oxfmt half. This wires up the second one: `lint:fmt-in-markdown` runs `lint-roller-markdown-oxfmt` over docs/ as part of `lint:docs`, using docs/.oxfmtrc.json, which matches the repo's .oxfmtrc.json except that docs snippets keep their semicolon-free style. `--fix` writes the formatted blocks back, and a block can opt out with `@noformat` in its info string. * docs: format code blocks with oxfmt Result of `lint-roller-markdown-oxfmt --fix` with docs/.oxfmtrc.json, plus the @ts-expect-error line anchors (and one Docusaurus highlight marker) that moved with the reformat. The Babel output sample in the ESM guide and the two excerpts of repo source in creating-api.md are marked @noformat, and the contentTracing example passes an async callback instead of wrapping an IIFE so that it does not need a leading semicolon. --------- Co-authored-by: Claude <[email protected]> (cherry picked from commit ad3a896) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Sanders <[email protected]> Co-authored-by: Claude <[email protected]>
MarshallOfSound
added a commit
that referenced
this pull request
Sep 21, 2026
…ks with oxfmt (42-x-y) (#54160) * docs: use json5 for bare object literal code blocks (#54107) * docs: use json5 for bare object literal code blocks Several docs code blocks contain only a bare object literal (an example return value or options object) but are tagged as `js`. As JavaScript, `{ key: value, ... }` on its own is a block statement, not an object, so standard/ESLint reports "Parsing error: Unexpected token :" on most of them; they only lint today because @electron/lint-roller special-cases them with a regex that wraps orphan `{...}` blocks in parens before linting. The blocks are valid JSON5, so tag them as such and drop the `<!-- eslint-skip -->` comments that preceded them, which nothing in the current tooling honors. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NBwKFgaRoEHjxoyGFpU6Ck * docs: use json5 for bare array menu template blocks The three menu template examples in docs/tutorial/menus.md are bare array literals, not runnable JavaScript. Like the bare object literal blocks in the previous commit, they are valid JSON5, so tag them as such instead of `js`. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NBwKFgaRoEHjxoyGFpU6Ck * docs: use json5 for bare literal blocks nested in blockquotes The radio menu item example in the `[!TIP]` blockquote in docs/tutorial/menus.md is a bare array literal tagged `js`; it was missed earlier because the fence is prefixed with `> `. It is valid JSON5 (including the trailing `//` comment), so tag it json5 like the other bare literal blocks. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NBwKFgaRoEHjxoyGFpU6Ck --------- Co-authored-by: Claude <[email protected]> (cherry picked from commit 2f64d2b) * build(deps-dev): bump oxlint from 1.57.0 to 1.80.0 (#53431) * build(deps-dev): bump oxlint from 1.57.0 to 1.80.0 Bumps [oxlint](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint) from 1.57.0 to 1.80.0. - [Release notes](https://github.com/oxc-project/oxc/releases) - [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxlint/CHANGELOG.md) - [Commits](https://github.com/oxc-project/oxc/commits/oxlint_v1.80.0/npm/oxlint) --- updated-dependencies: - dependency-name: oxlint dependency-version: 1.80.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * chore: satisfy lint rule --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Sanders <[email protected]> (cherry picked from commit 633785d) * build: update @electron/lint-roller to 4.0.0 (#54139) lint-roller 4 drops `lint-roller-markdown-standard` (and with it the transitive eslint/standard dependency tree, roughly 1,900 lines of yarn.lock) in favour of `lint-roller-markdown-oxlint`, which lints the JS code blocks in docs/ with the repo's own oxlint and .oxlintrc.json. It also makes `lint-roller-markdown-ts-check` work with TypeScript 6 and 7. - `lint:js-in-markdown` now runs `lint-roller-markdown-oxlint`. - `lint:docs-fiddles` ran the `standard` binary, which was only ever installed as a dependency of lint-roller 3, so it now runs oxlint over docs/fiddles instead. The dozen findings that surfaced (unused trailing callback parameters, one `require('path')`, one stale eslint-disable comment) are fixed in the fiddles, and the one tutorial that inlines an affected fiddle is kept in sync. - The `<!-- eslint-... -->` HTML comments in docs were directives for lint-roller-markdown-standard and are removed, and the docs style guide no longer points at standard-markdown. Co-authored-by: Claude <[email protected]> (cherry picked from commit 5eefaea) * build: check the formatting of docs code blocks with oxfmt (#54140) * build: check the formatting of docs code blocks with oxfmt lint-roller 4 splits the old `lint-roller-markdown-standard` into an oxlint half and an oxfmt half. This wires up the second one: `lint:fmt-in-markdown` runs `lint-roller-markdown-oxfmt` over docs/ as part of `lint:docs`, using docs/.oxfmtrc.json, which matches the repo's .oxfmtrc.json except that docs snippets keep their semicolon-free style. `--fix` writes the formatted blocks back, and a block can opt out with `@noformat` in its info string. * docs: format code blocks with oxfmt Result of `lint-roller-markdown-oxfmt --fix` with docs/.oxfmtrc.json, plus the @ts-expect-error line anchors (and one Docusaurus highlight marker) that moved with the reformat. The Babel output sample in the ESM guide and the two excerpts of repo source in creating-api.md are marked @noformat, and the contentTracing example passes an async callback instead of wrapping an IIFE so that it does not need a leading semicolon. --------- Co-authored-by: Claude <[email protected]> (cherry picked from commit ad3a896) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Claude <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Sanders <[email protected]>
2 tasks done
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.
Description of Change
Stacked on #54139.
Before: with lint-roller 4 the JS code blocks in docs/ are linted by oxlint but nothing checks their formatting any more (standard used to do both).
After:
lint:docsalso runslint-roller-markdown-oxfmt(npm run lint:fmt-in-markdown) withdocs/.oxfmtrc.json, which matches the root config except that docs snippets stay semicolon-free.npm run lint:fmt-in-markdown -- --fixrewrites blocks in place and a block can opt out with@noformatin its info string.The first commit is the wiring; the second is the one-off
--fixrun over docs (49 files, mostlyfunction name ()spacing, arrow parens and wrapping), plus the@ts-expect-error=[N]anchors and one Docusaurus highlight marker that moved with it. The Babel output sample in the ESM guide and the two excerpts of repo source in creating-api.md are marked@noformat.Checklist
Release Notes
Notes: none
Generated by Claude Code