Skip to content

Comments

tools: update eslint to v10#61905

Open
JLHwung wants to merge 8 commits intonodejs:mainfrom
JLHwung:update-eslint
Open

tools: update eslint to v10#61905
JLHwung wants to merge 8 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.

Disable `reportGlobalThis`, essentially restore the behaviour to ESLint v9.
@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.74%. Comparing base (199daab) to head (afff6b9).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61905      +/-   ##
==========================================
- Coverage   89.75%   89.74%   -0.02%     
==========================================
  Files         674      674              
  Lines      204886   204884       -2     
  Branches    39376    39380       +4     
==========================================
- Hits       183894   183865      -29     
- Misses      13280    13284       +4     
- Partials     7712     7735      +23     
Files with missing lines Coverage Δ
lib/internal/modules/cjs/loader.js 98.36% <100.00%> (-0.01%) ⬇️

... and 25 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.

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

Labels

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.

2 participants