-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingformattingRelated to whitespace/bracket formatting. We strongly recommend you use a formatter instead.Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
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
Repro Code
class EventEmitter { }
// @typescript-eslint/no-extra-parens: Unnecessary parentheses around expression
class _TypedEventEmitter extends (EventEmitter as any) { }
// error on following line:
class TypedEventEmitter2 extends EventEmitter as any { }ESLint Config
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/strict"
],
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": "./"
},
"root": true,
"rules": {
"@typescript-eslint/no-extra-parens": "warn"
}
}tsconfig
Expected Result
no-extra-parens should not occur on this line because the parentheses are needed.
Actual Result
After applying rule there is an error.
Additional Info
No response
Versions
| package | version |
|---|---|
@typescript-eslint/eslint-plugin |
5.36.2 |
@typescript-eslint/parser |
5.36.2 |
TypeScript |
4.8.3 |
ESLint |
8.23.0 |
node |
18.11.0 |
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingformattingRelated to whitespace/bracket formatting. We strongly recommend you use a formatter instead.Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
{ "compilerOptions": { "target": "ES2021", "strict": true, "module": "CommonJS", "moduleResolution": "node", "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "esModuleInterop": true, "skipLibCheck": true, "outDir": "dist/", "lib": [ "ES2021" ], "importHelpers": true, "sourceMap": true }, "include": [ "src/**/*" ], "exclude": [ "node_modules" ] }