Skip to content

Conversation

@gkjohnson
Copy link
Collaborator

Related issue: -

Description

The ESLint 9 configs have moved to a new flat config format. I've migrated some of my other projects so I thought I'd try it here, trying to keep the rules the same as much as I can. Settings like "jsdoc" rules have since changed to a separate plugin and in the future some of the styling rules will change to a separate code style plugin. There is an open issue at the mdcs plugin here to migrate, as well.

Comment on lines -56 to +63
"lint-addons": "eslint examples/jsm --ext .js --ignore-pattern libs --ignore-pattern ifc",
"lint-examples": "eslint examples --ext .html",
"lint-docs": "eslint docs --ignore-pattern prettify.js",
"lint-editor": "eslint editor --ignore-pattern libs",
"lint-playground": "eslint playground --ignore-pattern libs",
"lint-manual": "eslint manual --ignore-pattern 3rdparty --ignore-pattern prettify.js --ignore-pattern shapefile.js",
"lint-test": "eslint test --ignore-pattern vendor",
"lint-utils": "eslint utils --ignore-pattern prettify --ignore-pattern fuse",
"lint-addons": "eslint examples/jsm",
"lint-examples": "eslint examples",
"lint-docs": "eslint docs",
"lint-editor": "eslint editor",
"lint-playground": "eslint playground",
"lint-manual": "eslint manual",
"lint-test": "eslint test",
"lint-utils": "eslint utils",
Copy link
Collaborator Author

@gkjohnson gkjohnson Dec 4, 2025

Choose a reason for hiding this comment

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

Since ignore patterns are included in the config, now, it's possible we can merge these commands together and let the user specify any sub folder checks themselves. I can look into adding these back if they're preferred, though.

My "lint" scripts are set to eslint . so the whole project is validated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Mugen87 I see you've 👍 the comment - do you want me to change anything here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would keep the commands for now. The 👍 was for the simplification of the commands in package.json^^.

'no-async-promise-executor': 'off',
'no-empty': 'off',

// 'jsdoc/check-types': 'error',
Copy link
Collaborator Author

@gkjohnson gkjohnson Dec 4, 2025

Choose a reason for hiding this comment

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

When this is enabled there are some errors in the JSDoc comments that are caught. I'll leave it to another contribution to re-enable and fix these. It may be worth enabling the JSDoc "recommended" settings above to see if there are any rules worth keeping from there, too.

Comment on lines +105 to +110
'no-useless-escape': 'off',
'no-case-declarations': 'off',
'no-cond-assign': 'off',
'getter-return': 'off',
'no-async-promise-executor': 'off',
'no-empty': 'off',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I turned these off because they seemed to be new rules and were causing lint errors / warnings. It may be worth considering adjusting the codebase and turning these on.

Comment on lines +69 to +70
BigInt: 'readonly',
BigUint64Array: 'readonly'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These lines have been newly added

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 350.26
83.01
350.26
83.01
+0 B
+0 B
WebGPU 616.03
171
616.03
171
+0 B
+0 B
WebGPU Nodes 614.64
170.74
614.64
170.74
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 482.3
117.81
482.3
117.81
+0 B
+0 B
WebGPU 687.42
186.76
687.42
186.76
+0 B
+0 B
WebGPU Nodes 637.26
173.94
637.26
173.94
+0 B
+0 B

@danrossi
Copy link
Contributor

danrossi commented Dec 7, 2025

This is needed. For some reason I can't run lint now. It seems to be collecting another lint file further up a directory.

> [email protected] lint-addons
> eslint examples/jsm --ext .js --ignore-pattern libs --ignore-pattern ifc

Invalid option '--ext' - perhaps you meant '-c'?
You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.

@gkjohnson
Copy link
Collaborator Author

@Mugen87 Is this okay to merge? Will you be able to take a look at some of the jsdoc configs afterward?


This is needed. For some reason I can't run lint now. It seems to be collecting another lint file further up a directory.

This must be something else related to your setup. The project has been using eslint 8.x with the legacy config without issue for awhile now.

@danrossi
Copy link
Contributor

danrossi commented Dec 9, 2025

@Mugen87 Is this okay to merge? Will you be able to take a look at some of the jsdoc configs afterward?

This is needed. For some reason I can't run lint now. It seems to be collecting another lint file further up a directory.

This must be something else related to your setup. The project has been using eslint 8.x with the legacy config without issue for awhile now.

I have installed an eslint 9 config in a top level directory. And three is checked out in a sub directory. It was working until I added that and installed eslint 9 in my project. When I moved the eslint config which exists two directories up. The error goes away. VSCode lint syncs up with three requirements apart from an indent config I had to change from space to tab as I use 4 spaces everywhere else so it's auto linting now for PR's.

@Mugen87 Mugen87 added this to the r182 milestone Dec 9, 2025
@Mugen87
Copy link
Collaborator

Mugen87 commented Dec 9, 2025

Will you be able to take a look at some of the jsdoc configs afterward?

Yes, I'll check out what's going on.

@gkjohnson gkjohnson merged commit 9f2fb59 into mrdoob:dev Dec 9, 2025
10 checks passed
@gkjohnson gkjohnson deleted the eslint-upgrade branch December 9, 2025 09:24
This was referenced Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants