Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

'expected variable-declaration to have a typedef' lint error on for...of loops #743

Closed
SpenceDiNicolantonio opened this issue Oct 17, 2015 · 1 comment

Comments

@SpenceDiNicolantonio
Copy link

When using "typedef": [true, "variable-declaration"],tslint complains about variables within for...of loop declarations; however typedefs are not allowed in this context.

The following will result in a expected variable-declaration: 'thing' to have a typedef error from tslint:

for (let thing of setOfThings) {
    ...
}

but specifying a typedef on thing results in the following tsc compilation error:
error TS2483: The left-hand side of a 'for...of' statement cannot use a type annotation

The typedef rule should ignore variables declared within for...of loop declarations

@jkillian
Copy link
Contributor

Thanks for the report! I've filed a PR to get that fixed up

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants