-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershas 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/typedef": [
"error",
{
"variableDeclaration": true
},
],
}
}
// error @typescript-eslint/typedef : expected item to have a type annotation
for (const item of ['a', 'b']) {
}
Expected Result
The error should not be reported for a for..of loop variable.
Actual Result
The error is reported. The error is impossible to fix, because TypeScript does not allow type annotations here.
Additional Info
TSLint encountered this same problem as palantir/tslint#743.
Their fix is here and might be relevant: palantir/tslint#745
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.0.0-alpha.4 |
@typescript-eslint/parser |
1.13.0 |
TypeScript |
3.5.3 |
ESLint |
6.1.0 |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershas 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