Repository navigation
chore: lint code blocks in docs with ESLint - #42113
Merged
Merged
Conversation
dsanders11
force-pushed
the
chore/eslint-code-blocks
branch
from
June 26, 2024 01:27
925a227 to
f448ad2
Compare
dsanders11
marked this pull request as ready for review
June 26, 2024 02:50
dsanders11
marked this pull request as draft
June 26, 2024 02:52
dsanders11
force-pushed
the
chore/eslint-code-blocks
branch
from
August 13, 2024 21:11
3a0ce70 to
469c00e
Compare
dsanders11
force-pushed
the
chore/eslint-code-blocks
branch
2 times, most recently
from
October 4, 2024 23:05
6539312 to
9ad8bc7
Compare
dsanders11
force-pushed
the
chore/eslint-code-blocks
branch
from
October 21, 2024 21:55
9ad8bc7 to
210f1a4
Compare
dsanders11
marked this pull request as ready for review
October 21, 2024 23:41
dsanders11
force-pushed
the
chore/eslint-code-blocks
branch
from
November 12, 2024 22:17
210f1a4 to
502940b
Compare
dsanders11
force-pushed
the
chore/eslint-code-blocks
branch
from
May 27, 2025 07:54
502940b to
a306f00
Compare
erickzhao
reviewed
May 27, 2025
Comment on lines
+13
to
+33
| "@typescript-eslint/no-unused-vars": "off", | ||
| "indent": "off", | ||
| "no-undef": "off", | ||
| "no-unused-expressions": "off", | ||
| "no-unused-vars": "off", | ||
| "semi": "off", | ||
| "unicorn/prefer-node-protocol": "error" |
Member
There was a problem hiding this comment.
should we extends: standard as shorthand here?
Member
Author
There was a problem hiding this comment.
I've added that and dropped a couple of these rules (semi: off and indent: off) by excluding a couple more blocks from specific ESLint rules. The rest of these are actually the inverse of what they'd be in standard, specifically turning off unused/undefined checking because a lot of our code blocks are fragments which trip those rules, and that's fine for docs.
dsanders11
force-pushed
the
chore/eslint-code-blocks
branch
2 times, most recently
from
May 28, 2025 05:03
ba5bc0b to
0661b7b
Compare
dsanders11
force-pushed
the
chore/eslint-code-blocks
branch
from
May 28, 2025 21:36
0661b7b to
390fb12
Compare
VerteDinde
approved these changes
May 29, 2025
|
No Release Notes |
1 task done
kigh-ota
pushed a commit
to kigh-ota/electron
that referenced
this pull request
Sep 30, 2025
PKRoma
pushed a commit
to PKRoma/electron
that referenced
this pull request
Apr 5, 2026
Consolidates the root .eslintrc.json and five nested configs (build, script, docs, default_app, spec) into a single .oxlintrc.json at the repo root. script/lint.js now shells out to the oxlint binary from node_modules/.bin instead of using the ESLint Node API, and emits GitHub Actions annotations directly via --format=github in CI (replacing the deleted eslint-stylish problem matcher). Oxlint has no markdown processor, so the ESLint-based lint of JS code blocks in docs/**/*.md is replaced with an inline regex check for bare Node.js builtin imports. This preserves the rule docs/.eslintrc.json was originally added for in electron#42113; the rest of the standard ruleset on docs code blocks was already being enforced in parallel by lint-roller-markdown-standard.
MarshallOfSound
added a commit
that referenced
this pull request
Apr 6, 2026
Consolidates the root .eslintrc.json and five nested configs (build, script, docs, default_app, spec) into a single .oxlintrc.json at the repo root. script/lint.js now shells out to the oxlint binary from node_modules/.bin instead of using the ESLint Node API, and emits GitHub Actions annotations directly via --format=github in CI (replacing the deleted eslint-stylish problem matcher). Oxlint has no markdown processor, so the ESLint-based lint of JS code blocks in docs/**/*.md is replaced with an inline regex check for bare Node.js builtin imports. This preserves the rule docs/.eslintrc.json was originally added for in #42113; the rest of the standard ruleset on docs code blocks was already being enforced in parallel by lint-roller-markdown-standard.
2 tasks done
jkleinsc
pushed a commit
that referenced
this pull request
Oct 19, 2026
* docs: fix code block line highlighting after lint reformats Several highlighted code blocks in the IPC and preload tutorials had their line-highlight ranges drift when the docs code blocks were auto-formatted (the `import/order` blank line added in #42113, and the if/else collapse in #38260), so the highlights now land one line off from the code they were meant to call out. Update the ranges to point back at the originally highlighted code without changing the code blocks themselves. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E * docs: fix code block line highlighting that drifted from content edits The Playwright examples in automated-testing.md lost a line when their two `require` statements were merged, leaving the highlights one line late, and the code signing examples replaced a two-line certificate option with a `windowsSign` object while keeping the old two-line ranges. Point the highlights back at the intended code and cover the whole `windowsSign` object. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E --------- Co-authored-by: Claude <[email protected]>
jkleinsc
pushed a commit
that referenced
this pull request
Oct 19, 2026
* docs: fix code block line highlighting after lint reformats Several highlighted code blocks in the IPC and preload tutorials had their line-highlight ranges drift when the docs code blocks were auto-formatted (the `import/order` blank line added in #42113, and the if/else collapse in #38260), so the highlights now land one line off from the code they were meant to call out. Update the ranges to point back at the originally highlighted code without changing the code blocks themselves. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E Co-authored-by: Claude <[email protected]> * docs: fix code block line highlighting that drifted from content edits The Playwright examples in automated-testing.md lost a line when their two `require` statements were merged, leaving the highlights one line late, and the code signing examples replaced a two-line certificate option with a `windowsSign` object while keeping the old two-line ranges. Point the highlights back at the intended code and cover the whole `windowsSign` object. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E Co-authored-by: Claude <[email protected]> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Claude <[email protected]>
dsanders11
pushed a commit
that referenced
this pull request
Oct 19, 2026
* docs: fix code block line highlighting after lint reformats Several highlighted code blocks in the IPC and preload tutorials had their line-highlight ranges drift when the docs code blocks were auto-formatted (the `import/order` blank line added in #42113, and the if/else collapse in #38260), so the highlights now land one line off from the code they were meant to call out. Update the ranges to point back at the originally highlighted code without changing the code blocks themselves. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E Co-authored-by: Claude <[email protected]> * docs: fix code block line highlighting that drifted from content edits The Playwright examples in automated-testing.md lost a line when their two `require` statements were merged, leaving the highlights one line late, and the code signing examples replaced a two-line certificate option with a `windowsSign` object while keeping the old two-line ranges. Point the highlights back at the intended code and cover the whole `windowsSign` object. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E Co-authored-by: Claude <[email protected]> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Claude <[email protected]>
dsanders11
pushed a commit
that referenced
this pull request
Oct 19, 2026
* docs: fix code block line highlighting after lint reformats Several highlighted code blocks in the IPC and preload tutorials had their line-highlight ranges drift when the docs code blocks were auto-formatted (the `import/order` blank line added in #42113, and the if/else collapse in #38260), so the highlights now land one line off from the code they were meant to call out. Update the ranges to point back at the originally highlighted code without changing the code blocks themselves. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E Co-authored-by: Claude <[email protected]> * docs: fix code block line highlighting that drifted from content edits The Playwright examples in automated-testing.md lost a line when their two `require` statements were merged, leaving the highlights one line late, and the code signing examples replaced a two-line certificate option with a `windowsSign` object while keeping the old two-line ranges. Point the highlights back at the intended code and cover the whole `windowsSign` object. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E Co-authored-by: Claude <[email protected]> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Claude <[email protected]>
dsanders11
pushed a commit
that referenced
this pull request
Oct 20, 2026
* docs: fix code block line highlighting after lint reformats Several highlighted code blocks in the IPC and preload tutorials had their line-highlight ranges drift when the docs code blocks were auto-formatted (the `import/order` blank line added in #42113, and the if/else collapse in #38260), so the highlights now land one line off from the code they were meant to call out. Update the ranges to point back at the originally highlighted code without changing the code blocks themselves. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E Co-authored-by: Claude <[email protected]> * docs: fix code block line highlighting that drifted from content edits The Playwright examples in automated-testing.md lost a line when their two `require` statements were merged, leaving the highlights one line late, and the code signing examples replaced a two-line certificate option with a `windowsSign` object while keeping the old two-line ranges. Point the highlights back at the intended code and cover the whole `windowsSign` object. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01A9enZ3jn8BveASiB5p9G1E Co-authored-by: Claude <[email protected]> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Claude <[email protected]>
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
Main motivation at the moment is to run
unicorn/prefer-node-protocolover the code blocks, but it may also catch some other errors as well.cc @electron/docs
Checklist
Release Notes
Notes: none