8000 Bug: [no-extra-parens] False positive when calling generic function with type parameter with parentheses · Issue #5488 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

Bug: [no-extra-parens] False positive when calling generic function with type parameter with parentheses #5488

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

Closed
4 tasks done
xsjcTony opened this issue Aug 16, 2022 · 0 comments · Fixed by #5550
Closed
4 tasks done
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@xsjcTony
Copy link

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=4.7.4&jsx=true&sourceType=module&code=CYUwxgNghgTiAEYD2A7AzgF3gMwFzwB4AVAPgAoAPfIgSngF4T4oUBPAWACgvsCyUArgFsARiBjwAPvEwwAligDmNANoBdcioDkULQBp4ARjU0gA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge3oA99oBDWsX7RETVBkiJo0DtEjgwAXxBKgA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eFYDAruuGAL4g9A

Repro Code

declare const f: <T>(x: T) => any

f<(number | string)[]>(['a', 1])

ESLint Config

{
  "rules": {
    "@typescript-eslint/no-extra-parens": "error"
  }
}

tsconfig

{
  "compilerOptions": {
    "strict": true
  }
}

Expected Result

No error

Actual Result

@typescript-eslint/no-extra-parens: Unnecessary parentheses around expression. 3:23 - 3:24

Additional Info

Related to #2314

Versions

package version
@typescript-eslint/eslint-plugin 5.33.1
@typescript-eslint/parser 5.33.1
TypeScript 4.7.4
ESLint 8.22.0
node 16.16.0
@xsjcTony xsjcTony added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Aug 16, 2022
@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. and removed triage Waiting for team members to take a look labels Aug 16, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0