Skip to content

tools: update eslint to v10#61905

Merged
nodejs-github-bot merged 9 commits intonodejs:mainfrom
JLHwung:update-eslint
Mar 3, 2026
Merged

tools: update eslint to v10#61905
nodejs-github-bot merged 9 commits intonodejs:mainfrom
JLHwung:update-eslint

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Feb 20, 2026

In this PR we bumped tools/eslint to v10 and the @babel/* to 8.0.0-rc.2, the first version shipped with ESLint v10 support.

The eslint rules are revised due to breaking changes in ESLint v10. To limit the size of this PR, I have also turned off one new recommended rules in v10: no-useless-assignment, as it introduced hundreds of errors across the codebase. We can investigate later if we want to enable this rule.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/single-executable

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Feb 20, 2026
{ moduleName: requiredModule },
);
context.report({
node: node.body[0] ?? node,
Copy link
Contributor Author

@JLHwung JLHwung Feb 20, 2026

Choose a reason for hiding this comment

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

The ESLint v10 has modified the ranges of a Program to cover the leading comments.
https://eslint.org/docs/latest/use/migrate-to-10.0.0#-program-ast-node-range-spans-entire-source-text

As a result, the /* eslint-disable */ comment does not work if we still report error at the start of the program, since the comment will be after the start of the Program node. Here we report at the first statement.

c.f. eslint/eslint#20451

jsdoc.configs['flat/recommended'],
{
files: ['**/*.{js,cjs}'],
files: ['**/*.js'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ESLint will automatically set sourceType of .cjs to commonjs, so we don't need specify the sourceType for cjs files.

@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.65%. Comparing base (88be44d) to head (100c22a).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61905      +/-   ##
==========================================
- Coverage   89.65%   89.65%   -0.01%     
==========================================
  Files         676      676              
  Lines      206326   206324       -2     
  Branches    39520    39522       +2     
==========================================
- Hits       184990   184979      -11     
- Misses      13471    13491      +20     
+ Partials     7865     7854      -11     
Files with missing lines Coverage Δ
lib/internal/modules/cjs/loader.js 98.14% <100.00%> (-0.01%) ⬇️

... and 38 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Feb 22, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 22, 2026
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@sheplu sheplu left a comment

Choose a reason for hiding this comment

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

LGTM but do we want to wait for a stable release of babel?

@JLHwung
Copy link
Contributor Author

JLHwung commented Feb 22, 2026

do we want to wait for a stable release of babel?

I understand your concern, as a maintainer I am pretty confident about rc.2: features are frozen and the parser passed all test262 test cases for a long time. As the CI shows it also successfully parses all js files in this repo.

The remaining Babel 8 tasks towards a stable release are mostly typing improvements, as it is the first major Babel release with typing definitions. But we (the Node.js repo) don't use the typing part anyway so it is not very relevant.

I can open a new PR once Babel 8 reaches a stable release.

@bricss
Copy link
Contributor

bricss commented Feb 25, 2026

IMO, babel can probably be removed from the config, as eslint already supports all modern syntax features OOTB 🙂

@JLHwung
Copy link
Contributor Author

JLHwung commented Feb 25, 2026

Yes, you are right. The policy of ESLint is to support every stage 4 features, so it supports all modern syntax out of the box. However, I believe we used @babel/eslint-parser because of source phase imports, a stage 3 feature not yet supported by ESLint,

node/eslint.config.mjs

Lines 103 to 108 in 488a854

babelOptions: {
parserOpts: { createImportExpressions: true },
plugins: [
babelPluginSyntaxImportSource,
],
},

which is used in our docs (eslint also lints example codes):

node/doc/api/esm.md

Lines 749 to 764 in 488a854

```js
import source libraryModule from './library.wasm';
const instance1 = await WebAssembly.instantiate(libraryModule, importObject1);
const instance2 = await WebAssembly.instantiate(libraryModule, importObject2);
```
In addition to the static source phase, there is also a dynamic variant of the
source phase via the `import.source` dynamic phase import syntax:
```js
const dynamicLibrary = await import.source('./library.wasm');
const instance = await WebAssembly.instantiate(dynamicLibrary, importObject);
```

We could switch @babel/eslint-parser to espree once ESLint supports it, but we would require @babel/eslint-parser one day if we would like to showcase or use stage 3 features supported by V8.

@aduh95
Copy link
Contributor

aduh95 commented Mar 2, 2026

Can you please rebase to fix the confict?

@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 3, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 3, 2026
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 3, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Mar 3, 2026
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/61905
✔  Done loading data for nodejs/node/pull/61905
----------------------------------- PR info ------------------------------------
Title      tools: update eslint to v10 (#61905)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     JLHwung:update-eslint -> nodejs:main
Labels     lib / src, author ready, needs-ci
Commits    9
 - tools: bump eslint to v10, babel to v8.0.0-rc.2
 - tools: update rules for ESLint 10
 - tools: update eslint config
 - tools: no-unassigned-vars
 - tools: preserve-caught-error
 - tools: no-global-assign
 - tools: turn on no-shadow-restricted-names
 - tools: npm dedupe
 - tools: remove createImportExpressions from config
Committers 1
 - Huáng Jùnliàng <jlhwung@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 20 Feb 2026 18:39:24 GMT
   ✔  Approvals: 1
   ✔  - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/61905#pullrequestreview-3880933704
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-03-03T13:43:32Z: https://ci.nodejs.org/job/node-test-pull-request/71544/
- Querying data for job/node-test-pull-request/71544/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
   4eac93779a..3b9fe896c3  main       -> origin/main
✔  origin/main is now up-to-date
main is out of sync with origin/main. Mismatched commits:
 - 3b9fe896c3 2026-03-03, Version 25.8.0 (Current)
--------------------------------------------------------------------------------
HEAD is now at 3b9fe896c3 2026-03-03, Version 25.8.0 (Current)
   ✔  Reset to origin/main
- Downloading patch for 61905
From https://github.com/nodejs/node
 * branch                  refs/pull/61905/merge -> FETCH_HEAD
✔  Fetched commits as 4eac93779a99..100c22a248ea
--------------------------------------------------------------------------------
[main 741b0507e2] tools: bump eslint to v10, babel to v8.0.0-rc.2
 Author: Huáng Jùnliàng <jlhwung@gmail.com>
 Date: Fri Feb 20 13:29:31 2026 -0500
 2 files changed, 356 insertions(+), 501 deletions(-)
[main 6ef6cacc62] tools: update rules for ESLint 10
 Author: Huáng Jùnliàng <jlhwung@gmail.com>
 Date: Fri Feb 20 13:31:02 2026 -0500
 3 files changed, 13 insertions(+), 12 deletions(-)
[main 83dfb77af6] tools: update eslint config
 Author: Huáng Jùnliàng <jlhwung@gmail.com>
 Date: Fri Feb 20 13:31:26 2026 -0500
 1 file changed, 4 insertions(+), 3 deletions(-)
[main 8e4bfada25] tools: no-unassigned-vars
 Author: Huáng Jùnliàng <jlhwung@gmail.com>
 Date: Fri Feb 20 13:32:05 2026 -0500
 2 files changed, 2 insertions(+), 3 deletions(-)
[main 6348276f94] tools: preserve-caught-error
 Author: Huáng Jùnliàng <jlhwung@gmail.com>
 Date: Fri Feb 20 13:32:36 2026 -0500
 1 file changed, 5 insertions(+), 5 deletions(-)
[main b7ae3a99ff] tools: no-global-assign
 Author: Huáng Jùnliàng <jlhwung@gmail.com>
 Date: Fri Feb 20 13:32:49 2026 -0500
 2 files changed, 4 insertions(+)
[main 7030d2f8f4] tools: turn on no-shadow-restricted-names
 Author: Huáng Jùnliàng <jlhwung@gmail.com>
 Date: Fri Feb 20 13:48:11 2026 -0500
 1 file changed, 1 insertion(+), 1 deletion(-)
[main 907f2b1ac3] tools: npm dedupe
 Author: Huáng Jùnliàng <jlhwung@gmail.com>
 Date: Fri Feb 20 15:06:17 2026 -0500
 1 file changed, 5 insertions(+), 5 deletions(-)
[main 635cffe9c5] tools: remove createImportExpressions from config
 Author: Huáng Jùnliàng <jlhwung@gmail.com>
 Date: Sun Feb 22 11:47:48 2026 -0500
 1 file changed, 1 deletion(-)
   ✔  Patches applied
There are 9 commits in the PR. Attempting autorebase.
(node:350) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Rebasing (2/18)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools: bump eslint to v10, babel to v8.0.0-rc.2

PR-URL: #61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[detached HEAD 20ef4cca80] tools: bump eslint to v10, babel to v8.0.0-rc.2
Author: Huáng Jùnliàng <jlhwung@gmail.com>
Date: Fri Feb 20 13:29:31 2026 -0500
2 files changed, 356 insertions(+), 501 deletions(-)
Rebasing (3/18)
Rebasing (4/18)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools: update rules for ESLint 10

PR-URL: #61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[detached HEAD 4b6b54b0d6] tools: update rules for ESLint 10
Author: Huáng Jùnliàng <jlhwung@gmail.com>
Date: Fri Feb 20 13:31:02 2026 -0500
3 files changed, 13 insertions(+), 12 deletions(-)
Rebasing (5/18)
Rebasing (6/18)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools: update eslint config

PR-URL: #61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[detached HEAD 0c33053218] tools: update eslint config
Author: Huáng Jùnliàng <jlhwung@gmail.com>
Date: Fri Feb 20 13:31:26 2026 -0500
1 file changed, 4 insertions(+), 3 deletions(-)
Rebasing (7/18)
Rebasing (8/18)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools: no-unassigned-vars

PR-URL: #61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[detached HEAD 8f96759694] tools: no-unassigned-vars
Author: Huáng Jùnliàng <jlhwung@gmail.com>
Date: Fri Feb 20 13:32:05 2026 -0500
2 files changed, 2 insertions(+), 3 deletions(-)
Rebasing (9/18)
Rebasing (10/18)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools: preserve-caught-error

PR-URL: #61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[detached HEAD a6b3a0e290] tools: preserve-caught-error
Author: Huáng Jùnliàng <jlhwung@gmail.com>
Date: Fri Feb 20 13:32:36 2026 -0500
1 file changed, 5 insertions(+), 5 deletions(-)
Rebasing (11/18)
Rebasing (12/18)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools: no-global-assign

PR-URL: #61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[detached HEAD 37f1faf9c6] tools: no-global-assign
Author: Huáng Jùnliàng <jlhwung@gmail.com>
Date: Fri Feb 20 13:32:49 2026 -0500
2 files changed, 4 insertions(+)
Rebasing (13/18)
Rebasing (14/18)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools: turn on no-shadow-restricted-names

Disable reportGlobalThis, essentially restore the behaviour to ESLint v9.

PR-URL: #61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[detached HEAD cd4a002d0d] tools: turn on no-shadow-restricted-names
Author: Huáng Jùnliàng <jlhwung@gmail.com>
Date: Fri Feb 20 13:48:11 2026 -0500
1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (15/18)
Rebasing (16/18)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools: npm dedupe

PR-URL: #61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[detached HEAD e54e3c8cce] tools: npm dedupe
Author: Huáng Jùnliàng <jlhwung@gmail.com>
Date: Fri Feb 20 15:06:17 2026 -0500
1 file changed, 5 insertions(+), 5 deletions(-)
Rebasing (17/18)
Rebasing (18/18)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools: remove createImportExpressions from config

This option is enabled by default in Babel 8.

PR-URL: #61905
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>

[detached HEAD 24283e694d] tools: remove createImportExpressions from config
Author: Huáng Jùnliàng <jlhwung@gmail.com>
Date: Sun Feb 22 11:47:48 2026 -0500
1 file changed, 1 deletion(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/22631092293

@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Mar 3, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 3, 2026
@nodejs-github-bot nodejs-github-bot merged commit e554661 into nodejs:main Mar 3, 2026
78 of 79 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in e554661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants