Fix some flat config and eslint v9 related issues in eslint-plugin-mozilla
Categories
(Developer Infrastructure :: Lint and Formatting, task, P3)
Tracking
(firefox138 fixed)
Tracking | Status | |
---|---|---|
firefox138 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(3 files)
I've started looking at the flat configuration for ESLint, and noticed that we could make some improvements to eslint-plugin-mozilla to make it easier for switching to the flat configuration and ESLint v9. These are all independent and won't affect the legacy configuration.
- Add names to all the configurations.
- The flat configuration has a config inspector which shows which parts of the configuration are applied to which files. Having naming there greatly helps investigations.
- This also improves ESLint error messages if you get the configuration wrong.
- Switch more rules away from obsolete functions.
- We don't need to do this until we upgrade to v9. However, we've already switched some rules away, and I think these are the remaining ones to fix.
- Bump minimum supported version of ESLint to v8.57.1 - the last supported of the ESLint v8 series.
- Once we're on v9 I want to drop support for v8 so that we can switch eslint-plugin-mozilla to ES modules. Given that cleaning some of the obsolete functions up might break things, I want limit the version. I doubt anyone is using it on older versions, but if they are, they should update.
- Include eslint-plugin-jsdoc as an optional peer dependency.
- It is currently, however we don't list it, and we'll need to import it for the jsdoc configs. Hence adding it now so it is ready.
Assignee | ||
Comment 1•4 months ago
|
||
These make debugging configuration issues easier to handle.
The top-level .eslintrc.js change is so that we use the configuration handling system in index.js to be able to filter out the name for the legacy configuration set-ups.
Assignee | ||
Comment 2•4 months ago
|
||
Assignee | ||
Comment 3•4 months ago
|
||
jsdoc and sdl are both optional as they're not used for the recommended config. Currently the sdl peer dependency also causes issues with installing node_modules in eslint-plugin-mozilla, because it can't cope that 1.0.0 only supports ESLint v9, yet 0.2.2 will support ESLint v8.
Comment 5•4 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6f519279e6f3
https://hg.mozilla.org/mozilla-central/rev/32fdff16eb46
https://hg.mozilla.org/mozilla-central/rev/ed51740a3a4e
Description
•