Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade eslint to version 9.0.0 #17928

Open
timvandermeij opened this issue Apr 11, 2024 · 9 comments
Open

Upgrade eslint to version 9.0.0 #17928

timvandermeij opened this issue Apr 11, 2024 · 9 comments

Comments

@timvandermeij
Copy link
Contributor

We should upgrade to ESLint 9 now that it's officially released. The changelog, including the breaking changes that should be audited, can be found at https://github.com/eslint/eslint/releases/tag/v9.0.0. Note that this upgrade is currently blocked on the ESLint plugins that we use indicating support for ESLint 9 in their package.json ranges first, so this is mostly a tracking issue at the moment.

@wojtekmaj
Copy link
Contributor

wojtekmaj commented Apr 15, 2024

Let's make it a tracking issue then :D

Plugins

Plugin name Update status Development status Issue Comments
eslint-plugin-import ❓ Planned import-js/eslint-plugin-import#2948 Worth considering a switch to eslint-plugin-import-x, much more reasonably maintained alternative
eslint-plugin-jasmine 764e67e ✅ Implemented tlvince/eslint-plugin-jasmine@f9e0798
eslint-plugin-json ✅ Implemented azeemba/eslint-plugin-json#80 Update blocked by eslint-plugin-mozilla support for v4.0.0
eslint-plugin-no-unsanitized ✅ Implemented mozilla/eslint-plugin-no-unsanitized#234 Released in v4.1.0
eslint-plugin-sort-exports ❓ Unknown n/a
eslint-plugin-unicorn d7f2bc0 ✅ Implemented sindresorhus/eslint-plugin-unicorn#2250

timvandermeij added a commit to timvandermeij/pdf.js that referenced this issue May 14, 2024
This is a major version bump, but the changelog at
https://github.com/sindresorhus/eslint-plugin-unicorn/releases/tag/v53.0.0
doesn't indicate any breaking changes that should impact us.

Most notably it contains support for ESLint 9, which brings us a step
closer towards mozilla#17928.
@timvandermeij
Copy link
Contributor Author

In commit d7f2bc0 eslint-plugin-unicorn got upgraded to version 53.0.0 which contains support for ESLint 9, so we can cross that one off the list.

@nicolo-ribaudo
Copy link
Contributor

If you haven't already seen https://eslint.org/blog/2024/05/eslint-compatibility-utilities/, it might be useful for this. It provides wrappers to run ESLint 8 plugins in ESLint 9.

@mozfreddyb
Copy link

I can comment for eslint-plugin-no-unsanitized: It's planned but blocked on dependencies (heh)
mozilla/eslint-plugin-no-unsanitized#241

@timvandermeij
Copy link
Contributor Author

timvandermeij commented May 28, 2024

eslint-plugin-json 4.0.0 is now released and contains ESLint 9 support (see azeemba/eslint-plugin-json@0ff302c), but we can't update to it yet because eslint-plugin-mozilla has not indicated support for version 4.0.0 in package.json yet:

npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/eslint-plugin-json
npm error   dev eslint-plugin-json@"^4.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer eslint-plugin-json@"^3.1.0" from [email protected]
npm error node_modules/eslint-plugin-mozilla
npm error   dev eslint-plugin-mozilla@"^3.7.4" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/eslint-plugin-json
npm error   peer eslint-plugin-json@"^3.1.0" from [email protected]
npm error   node_modules/eslint-plugin-mozilla
npm error     dev eslint-plugin-mozilla@"^3.7.4" from the root project

@timvandermeij
Copy link
Contributor Author

In commit c77dbe0 eslint-plugin-jasmine got updated to version 4.2.0 which contains support for ESLint 9, so we also can cross that one off the list.

@timvandermeij
Copy link
Contributor Author

timvandermeij commented Aug 8, 2024

In PR #18571 the idea came up of trying to remove eslint-plugin-mozilla given that we only used three rules from it and after that PR we are down to two: one at https://github.com/mozilla/pdf.js/blob/master/extensions/chromium/.eslintrc#L19 and one at https://github.com/mozilla/pdf.js/blob/master/.eslintrc#L47. The latter is already covered by an existing unicorn rule, and the former may be removed in favor of explicitly documenting the remaining globals we have left. Note that when eslint-plugin-mozilla was introduced in 2e9ae50 there were more occurrences than nowadays, mainly because we don't have Firefox extension files in this repository anymore and we eliminated most globals usage.

We should check if this is possible since it would unblock the eslint-plugin-json update and that combined with the removal of eslint-plugin-mozilla would bring us two steps closer to ESLint 9. Note that we can't actually upgrade eslint-plugin-json yet because that version only supports ESLint 9 and isn't backwards compatible with ESLint 8, but it would remove the blocker.

@timvandermeij
Copy link
Contributor Author

In commit be93d53 eslint-plugin-mozilla got removed, so we also can cross that one off the list.

@mozfreddyb
Copy link

no-unsanitized now supports eslint 9. We just released a new version earlier in the week.

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

No branches or pull requests

4 participants