-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Bug]: @typescript-eslint
v6 throws deprecation warnings
#3602
Comments
cc @bradzacher @JoshuaKGoldberg is this by chance an easy PR? |
Yup, it is! Replace |
i assume we can use |
eye twitches |
You may not be able to simply use I think doing this instead should work: const typeArgs = 'typeArguments' in node ? node.typeArguments : node.typeParameters; and then use Though it seems like similar handling needs to be done for usage of I was testing this a bit and was able to get rid of this deprecation warning by monkey patching this kind of changes in |
A PR would be great. |
I'm just a maintainer on typescript-eslint, not eslint-plugin-react, but: please don't monkey patch modules if it's not absolutely necessary. You never know when those patches break downstream tools or are themselves broken by package updates. Especially when there's a recommended workaround in the thread (#3602 (comment)). I can't guarantee that we won't frequently break the patch by refactors on our end. @Haprog if the Edit: what ljharb said 👇 😄 |
It’s fine to do such patching temporarily to test out a PR you want to make, to be clear, just don’t commit or deploy it or anything :-P |
Yes, of course. What I meant with monkey patching in this case was that I was just locally modifying |
Ah got it, sorry for jumping at you there! 😄 |
@JoshuaKGoldberg btw related to the instruction here https://typescript-eslint.io/linting/troubleshooting/#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings
This was not very helpful even though I was only using about 5 plugins since disabling a plugin you also need to remove or comment out the rules related to that plugin and also need to remove related "eslint-disable " comments in your code to be able to run without errors (otherwise you'll get errors about missing rule definitions). I found a much easier way to figure out which plugin is causing issues is to run with Node's npx cross-env NODE_OPTIONS=--trace-deprecation npm test to get better debugging output and see which plugin/file/line is causing the issues without disabling any plugins/rules. This will give output like so:
|
Any updates on this? |
nope, or they'd be posted on the issue. |
Are maintainers open to PRs to fix it? I can make some time in the next week or so. |
@benasher44 yes! altho #3629 already exists, so instead of a new PR, please comment on that PR with a link to a branch or commit, and I'll pull in your changes. |
Is there an existing issue for this?
Description Overview
Using
@typescript-eslint/parser
6.x throws a warning on the command line sayingDeprecationWarning: The 'typeParameters' property is deprecated on CallExpression nodes. Use 'typeArguments' instead
.My project is an ejected CRA config; this prints out on the command line every time that I run
eslint src
on my project after I upgraded my@typescript-eslint
dependencies to use the latest v6.See https://typescript-eslint.io/linting/troubleshooting/#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings for more info.
Expected Behavior
A warning should not be printed for deprecations.
eslint-plugin-react version
v7.32.2
eslint version
v8.45.0
node version
v18.16.1
The text was updated successfully, but these errors were encountered: