Closed
Description
Repro
{
"rules": {
"@typescript-eslint/no-unnecessary-type-assertion": "error"
}
}
function test() {
let resolve: () => void
new Promise(resolve0 => {
resolve = resolve0
})
return resolve!
}
Expected Result
No errors because it's a syntax error if I removed the !
.
Actual Result
6:12 error This assertion is unnecessary since it does not change the type of the expression @typescript-eslint/no-unnecessary-type-assertion
Additional Info
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
1.7.0 |
@typescript-eslint/parser |
1.7.0 |
TypeScript |
3.4.3 |
ESLint |
5.16.0 |
node |
10.15.3 |
npm |
6.9.0 |
Metadata
Metadata
Assignees
Labels
Something isn't workingSomething isn't workingthere is a PR raised to close thisthere is a PR raised to close thisIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin