Skip to content

build: check the formatting of docs code blocks with oxfmt - #54140

Merged
MarshallOfSound merged 2 commits into
claude/lint-roller-4from
claude/docs-oxfmt
Sep 21, 2026
Merged

MarshallOfSound merged 2 commits into
claude/lint-roller-4from
claude/docs-oxfmt

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

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:docs also runs lint-roller-markdown-oxfmt (npm run lint:fmt-in-markdown) with docs/.oxfmtrc.json, which matches the root config except that docs snippets stay semicolon-free. npm run lint:fmt-in-markdown -- --fix rewrites blocks in place and a block can opt out with @noformat in its info string.

The first commit is the wiring; the second is the one-off --fix run over docs (49 files, mostly function 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

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.
@MarshallOfSound
MarshallOfSound merged commit ad3a896 into main Sep 21, 2026
124 of 129 checks passed
@MarshallOfSound
MarshallOfSound deleted the claude/docs-oxfmt branch September 21, 2026 07:18
@release-clerk

release-clerk Bot commented Sep 21, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "45-x-y", please check out #54157

@trop

trop Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "44-x-y", please check out #54158

@trop

trop Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "43-x-y", please check out #54159

@trop

trop Bot commented Sep 21, 2026

Copy link
Copy Markdown
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]>
@trop trop Bot added merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/45-x-y in-flight/44-x-y in-flight/43-x-y labels Sep 21, 2026
@trop trop Bot added merged/44-x-y PR was merged to the "44-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. no-backport semver/none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants