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

Bug: @typescript-eslint/no-extra-parens applying erroneously to class extensions #5899

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingformattingRelated to whitespace/bracket formatting. We strongly recommend you use a formatter instead.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@phm07

Description

@phm07

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 havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=4.8.4&sourceType=module&code=MYGwhgzhAECiBuBTAdgF1gWwJatYgTtAN7QC+AsAFBUD0N0AAqgJ4AOiEw+WrqAtBxBY0NZAHsBAD1T4wfVmHwoIALmgBVZMkTAOERc2gKlaABYcO0RWICuyACbREk1kqhYxyKqEgwA+gAqbIj2CCjo2LgETtIo9jAAFGFomDh4hJBWyMwAlMRkVLT0BPhihJ7QAGZiICBiAO7CAObQQtoqRdA+UNBB7KFIKZHpAEwxeA4wyRFp0Zlg2fkUlEA&eslintrc=N4KABGBECmAeAu0B2ATAzpAXGA2uCU0aANgJZLyYBO0AxgPYC2jyK0KkANPhJAA7EArgHNymAALwAnnyK0qpPvAC0RMhQD0aeAtrxI+ALrdefAIZU00KliiSZchUtUly8DecvWu+fkNFIGNh4BHbSsmjyiipqbgYQxr6eVlQA8kqk9IG2oKH8VPQAVnT62JAAdBrwkVkAZqTC5YVoWT551QxI9cIASvT08AAipDZllfFgAL4mUAUDtjqC0DOQVILERDk8UEj0yoJIglYoygBuFkFQ9LW1bQSQ9hFRzrGau-uHx2cXtiGhUAB3CxIO6hXL-XgWYRoACSwl2NAACmZ4IgqCCygA9AD6oP+kHOljhCOgyNR1g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bBF2QwrVs7HsAIMilRCS8ooFTTQl30HH8Hl-cO-WCi03qNAmbQGYZGRviud5BvXK7Yn9yI8jqiwG50UUKQWvyofWayaMDuIYaDaFwiTWi2d3ZAKTJDdeSMH7r1DmROen5YHkHtjQbI+9eCwIOPFOWKCQyQxODWFgEY5r4GFJMIAA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkeAhpgObp4VQCiAygEwAMPAIyQANOBqQSeTMmhtK0gK7oxNKPFgATRRnaQAwgg1EAUl1HjaG7RgBK6ErFSKCxPUS3oLayPVSpYAHcuAE8iPAALVlkAEXQAM3odPABJJFhMPDIFTGVVCUwHJwA3dBNHIgBZLR0vHLzLKAdqm3QU8KxYRHYlFUbJAGtkRAAZZAAjfSjoAZ7cvp9YFxjkTD1NZCkAem8JVAn2AG1G2m5+IUhGgF182mR0zIAJdFRELGywXtuoR0VMaHQlXo3Xq6HEAF98pBkERoM5NHUwMcfCR-lsAFTojGXCA3cSQdAADzhigRR36HgRAH1rLUyOIriBwUA

Repro Code

classEventEmitter{}//@typescript-eslint/no-extra-parens: Unnecessary parentheses around expressionclass_TypedEventEmitterextends(EventEmitterasany){}// error on following line:classTypedEventEmitter2extendsEventEmitterasany{}

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

{"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"  ]}

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

packageversion
@typescript-eslint/eslint-plugin5.36.2
@typescript-eslint/parser5.36.2
TypeScript4.8.3
ESLint8.23.0
node18.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingformattingRelated to whitespace/bracket formatting. We strongly recommend you use a formatter instead.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp