Skip to content

build: migrate from eslint to oxlint - #50691

Merged
MarshallOfSound merged 1 commit into
mainfrom
chore/migrate-eslint-to-oxlint
Apr 6, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
chore/migrate-eslint-to-oxlint

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Replaces ESLint and its plugin ecosystem with oxlint. Part of aligning JS tooling across the org.

  • Consolidates root .eslintrc.json plus 13 nested configs into a single .oxlintrc.json
  • script/lint.js spawns the oxlint binary directly instead of the ESLint Node API; emits GitHub Actions annotations natively (--format=github), so the eslint-stylish problem matcher is dropped
  • Per-process no-restricted-imports rules from lib/**/.eslintrc.json are preserved as overrides
  • mocha/no-exclusive-tests is replaced by a ~25-line in-repo plugin at script/lint-plugins/no-only-tests.mjs
  • The docs-markdown ESLint pass is replaced by an inline check for bare node: builtins in code blocks (the only rule that pass was added for in chore: lint code blocks in docs with ESLint #42113); broader standard enforcement on docs code blocks already runs via @electron/lint-roller
  • yarn.lock: -1913 / +235 lines, ~160 transitive packages removed
  • yarn lint:js over 569 files: ~640ms

A handful of pre-existing warnings that ESLint was lenient on are addressed inline (mostly _-prefixing unused leading args before a rest spread, plus two targeted disables where oxlint's stricter analysis flags intentional throw error / reject(string)).

Notes: none

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.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedoxlint@​1.57.0991009195100

View full report

@MarshallOfSound MarshallOfSound added target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. labels Apr 5, 2026

@VerteDinde VerteDinde left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 Excited for this move

@MarshallOfSound
MarshallOfSound merged commit 6ed3198 into main Apr 6, 2026
131 of 135 checks passed
@MarshallOfSound
MarshallOfSound deleted the chore/migrate-eslint-to-oxlint branch April 6, 2026 16:05
@release-clerk

release-clerk Bot commented Apr 6, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "42-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "40-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot removed the target/42-x-y PR should also be added to the "42-x-y" branch. label Apr 6, 2026
@trop

trop Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "39-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/42-x-y and removed target/40-x-y PR should also be added to the "40-x-y" branch. labels Apr 6, 2026
@trop

trop Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "41-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/40-x-y needs-manual-bp/39-x-y needs-manual-bp/41-x-y and removed target/39-x-y PR should also be added to the "39-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. labels Apr 6, 2026
@ckerr ckerr mentioned this pull request May 1, 2026
5 tasks done
@trop

trop Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

@ckerr has manually backported this PR to "42-x-y", please check out #51435

@trop

trop Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

@ckerr has manually backported this PR to "41-x-y", please check out #51443

MarshallOfSound pushed a commit that referenced this pull request May 2, 2026
* build: replace eslint with oxlint and add oxfmt

Replace ESLint and its plugin ecosystem with oxlint (oxc.rs).
Add oxfmt alongside oxlint for JS/TS formatting and import sorting.

- Consolidate root .eslintrc.json plus 13 nested configs into .oxlintrc.json
- script/lint.js spawns oxlint binary directly instead of ESLint Node API
- Per-process no-restricted-imports rules preserved as oxlintrc overrides
- mocha/no-exclusive-tests replaced by in-repo plugin (no-only-tests.mjs)
- docs ESLint pass replaced by inline node: protocol check in lint.js
- .oxfmtrc.json matching repo style (single quotes, semicolons, 2-space)
- yarn lint:fmt (oxfmt --check) chained into yarn lint
- yarn format (oxfmt --write) for local fixup
- lint-staged runs oxfmt --write on staged JS/TS files

This commit contains only rule/tooling infrastructure changes and is
intended to be cherry-picked to other maintenance branches, where
formatting and lint fixes can be applied separately.

Manual backport of e1af67c698 (#50691) and
3c7fd34f47 (#50692).

* chore: apply oxfmt formatting and oxlint fixes

One-time application of the new linting and formatting rules to the
41-x-y codebase:

- yarn format (oxfmt --write) over all JS/TS sources
- oxlint --fix to restore curly braces where oxfmt removed them
- Prefix unused parameters with _ (no-unused-vars)
- Add eslint-disable-next-line comments for intentional patterns:
  - prefer-promise-reject-errors in desktop-capturer.ts
  - no-throw-literal in preload.ts
  - no-only-tests/no-only-tests in spec-helpers.ts
- Restore bare require() in preload-sandbox.js test assertions
  (oxfmt incorrectly converted bare specifiers to node: protocol,
  defeating the equivalence test)

Pure formatting and lint suppression; no behavioral changes.
@trop trop Bot added merged/41-x-y PR was merged to the "41-x-y" branch. and removed in-flight/41-x-y labels May 2, 2026
MarshallOfSound pushed a commit that referenced this pull request May 2, 2026
* build: replace eslint with oxlint and add oxfmt

Replace ESLint and its plugin ecosystem with oxlint (oxc.rs).
Add oxfmt alongside oxlint for JS/TS formatting and import sorting.

- Consolidate root .eslintrc.json plus 13 nested configs into .oxlintrc.json
- script/lint.js spawns oxlint binary directly instead of ESLint Node API
- Per-process no-restricted-imports rules preserved as oxlintrc overrides
- mocha/no-exclusive-tests replaced by in-repo plugin (no-only-tests.mjs)
- docs ESLint pass replaced by inline node: protocol check in lint.js
- .oxfmtrc.json matching repo style (single quotes, semicolons, 2-space)
- yarn lint:fmt (oxfmt --check) chained into yarn lint
- yarn format (oxfmt --write) for local fixup
- lint-staged runs oxfmt --write on staged JS/TS files

This commit contains only rule/tooling infrastructure changes and is
intended to be cherry-picked to other maintenance branches, where
formatting and lint fixes can be applied separately.

Manual backport of e1af67c698 (#50691) and
3c7fd34f47 (#50692).

* chore: apply oxfmt formatting and oxlint fixes

One-time application of the new linting and formatting rules to the
42-x-y codebase:

- yarn format (oxfmt --write) over all JS/TS sources
- oxlint --fix to restore curly braces where oxfmt removed them
- Prefix unused parameters with _ (no-unused-vars)
- Add eslint-disable-next-line comments for intentional patterns:
  - prefer-promise-reject-errors in desktop-capturer.ts
  - no-throw-literal in preload.ts

Pure formatting and lint suppression; no behavioral changes.
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels May 2, 2026
@ckerr ckerr mentioned this pull request May 5, 2026
5 tasks done
@trop

trop Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

@ckerr has manually backported this PR to "40-x-y", please check out #51500

MarshallOfSound pushed a commit that referenced this pull request May 7, 2026
* build: replace eslint with oxlint and add oxfmt

Replace ESLint and its plugin ecosystem with oxlint (oxc.rs).
Add oxfmt alongside oxlint for JS/TS formatting and import sorting.

- Consolidate root .eslintrc.json plus 13 nested configs into .oxlintrc.json
- script/lint.js spawns oxlint binary directly instead of ESLint Node API
- Per-process no-restricted-imports rules preserved as oxlintrc overrides
- mocha/no-exclusive-tests replaced by in-repo plugin (no-only-tests.mjs)
- docs ESLint pass replaced by inline node: protocol check in lint.js
- .oxfmtrc.json matching repo style (single quotes, semicolons, 2-space)
- yarn lint:fmt (oxfmt --check) chained into yarn lint
- yarn format (oxfmt --write) for local fixup
- lint-staged runs oxfmt --write on staged JS/TS files

This commit contains only rule/tooling infrastructure changes and is
intended to be cherry-picked to other maintenance branches, where
formatting and lint fixes can be applied separately.

Manual backport of e1af67c698 (#50691) and
3c7fd34f47 (#50692).

* chore: apply oxfmt and oxlint formatting changes

Run oxfmt --write and oxlint --fix across all JS/TS sources to
apply the new formatting and lint rules from the previous commit.

* chore: remove accidentally-included CLAUDE.md
@trop trop Bot added merged/40-x-y PR was merged to the "40-x-y" branch. and removed in-flight/40-x-y labels May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. semver/none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants