-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Repro
{
"rules": {
"@typescript-eslint/no-extra-parens": ["error"]
}
}
function foo(a: string): number
{
return ((a as any) | 0) - 1;
}
Expected Result
No warning.
Actual Result
Produces a warning:
Unnecessary parentheses around expression
Autofixed code has different semantics:
function foo(a: string): number
{
return a as any | 0 - 1;
}
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
1.13.0 |
@typescript-eslint/parser |
1.13.0 |
TypeScript |
3.5.3 |
ESLint |
6.1.0 |
node |
12.7.0 |
npm |
6.10.0 |
Playground links
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin