-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
chore: Upgrade ESLint to v9 #24273
chore: Upgrade ESLint to v9 #24273
Conversation
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No dependency changes detected in pull request |
'@typescript-eslint': typescriptEslint, | ||
jest, | ||
'simple-import-sort': simpleImportSort, | ||
import: fixupPluginRules(_import), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! That's interesting, because I identified this as a blocker recently and this unblocks it.
(In #24148 (review))
Thanks a lot @nzakas! 🙌🏼 I think we can ignore these errors for the Could you do that? I could not push a commit because of a permission error. Also, we would need to have the CLA signed to be able to merge the PR later. Could you check this in the message above? Ping @millsp for info and for the |
Thanks @nzakas for taking the time, this is very much appreciated. @Jolg42 @nzakas these eslint errors should be ignored as it is intentional in the implementation.
and the variable producing an error here can be prefixed with an underscore to suppress the error.
|
CLA signed. Updated the config file to ignore the |
...compat.extends( | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'plugin:prettier/recommended', | ||
'plugin:jest/recommended', | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see only one problem in this part. eslintrc will be long not supported and not maintened again. The compat "transforms" the configuration to support eslintrc old configuration. In this case i really want the best thing is to adapt fully to new eslint format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good approach in the long run. For right now, there are still too many plugins that don't officially support the new config format, so we need this. You can always revisit later as plugins are updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeScript eslint now support Eslint v9. Here's a explain typescript-eslint/typescript-eslint#8211 (comment)
Prettier too have a Eslint v9 support. Here's a merged PR prettier/eslint-plugin-prettier#616
And you can see all supported parsers/plugins in the issue 18391
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I maintain ESLint, so I'm aware. :)
This is just meant to be a courtesy PR to help get you started. This was generated by our new migration tool so there are some inefficiencies, but you can modify this however you'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Now i understand everything, thanks for the explain
{ | ||
files: ['**/*.ts'], | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the v9 release eslint give's a way to define rules for specific file extensions. in this block you have only a file extensions without inserting rules and others things. Are that really working good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This is telling ESLint to search for **/*.ts
files by default. This replaces the --ext .ts
command line flag. You can optionally include additional configuration if you want, but the primary focus of this entry is to ensure that TypeScript files are search for by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot 🙌🏼
This is an attempt to upgrade the repo to ESLint v9.
I've verified that the new config file works and ESLint runs. However, there are some outstanding ESLint errors that need review from someone familiar with the codebase. I believe these are valid, but they didn't show up before the migration, so it's possible you may want to ignore them.