Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Fix] Avoid typescript-eslint deprecation warnings about typeParameters#3788

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
pxpeterxu wants to merge2 commits intojsx-eslint:master
base:master
Choose a base branch
Loading
frompxpeterxu:peter-typescript-deprecation

Conversation

pxpeterxu
Copy link

Motivation

When usingeslint-plugin-react (7.35.0; latest) in a Typescript project with@typescript-eslint/parser": "^7.0.0", I got the following warnings when running ESLint:

# NODE_OPTIONS=--trace-deprecation yarn lint(node:236) DeprecationWarning: The 'typeParameters' property is deprecated on CallExpression nodes. Use 'typeArguments' instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.    at Object.defineProperty.get (/builds/cherrymoss/immigration/node_modules/@typescript-eslint/typescript-estree/dist/convert.js:2545:29)    at markAnnotatedFunctionArgumentsAsDeclared (/builds/cherrymoss/immigration/node_modules/eslint-plugin-react/lib/util/propTypes.js:1037:22)    at /builds/cherrymoss/immigration/node_modules/eslint-plugin-react/lib/util/Components.js:281:9    at Array.forEach (<anonymous>)    at mergedHandler (/builds/cherrymoss/immigration/node_modules/eslint-plugin-react/lib/util/Components.js:280:16)    at ruleErrorHandler (/builds/cherrymoss/immigration/node_modules/eslint/lib/linter/linter.js:1076:28)    at /builds/cherrymoss/immigration/node_modules/eslint/lib/linter/safe-emitter.js:45:58    at Array.forEach (<anonymous>)    at Object.emit (/builds/cherrymoss/immigration/node_modules/eslint/lib/linter/safe-emitter.js:45:38)    at NodeEventGenerator.applySelector (/builds/cherrymoss/immigration/node_modules/eslint/lib/linter/node-event-generator.js:297:26)

Changes

  • Change all references totypeParameters so that they:
    1. Try looking fortypeArguments first (to support@typescript-eslint/typescript-estree v7+)
    2. Fall back totypeParameters (to support@typescript-eslint/typescript-estree vv+)

Testing

Usedyarn patch-package to also patchpropTypes.js and verified that the deprecation errors disappeared on my project.

jdufresne reacted with thumbs up emoji
@codecovCodecov
Copy link

codecovbot commentedJul 22, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.75%. Comparing base(c6fdccd) to head(7feb778).

Additional details and impacted files
@@           Coverage Diff           @@##           master    #3788   +/-   ##=======================================  Coverage   97.75%   97.75%           =======================================  Files         135      135             Lines        9715     9719    +4       Branches     3527     3530    +3     =======================================+ Hits         9497     9501    +4  Misses        218      218

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

@ljharb
Copy link
Member

Unfortunately we're not even testing on v6 yet, let alone v7 - see#3629, which I think this would need to be blocked on (or, that one would cover this one)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@pxpeterxu@ljharb

[8]ページ先頭

©2009-2025 Movatter.jp