-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
What code were you trying to parse?
[1].forEach(value => value + 1);
What did you expect to happen?
No warnings
What actually happened?
A warning from @typescript-eslint/restrict-plus-operands
rule.
After a bit of debugging I found out that type checker returned any
type for the value
node. It happened because project
didn't contain a reference to package's tsconfig file, so this file was linted in a context of an inferred project.
I've tried to reproduce it in an isolated environment and looks like it works correctly if there is only one project.
UPD: After reading source it makes sense that it can't do the same thing it does with a single config, but falling back to the same program used for non-type-checked rules should also make rules handle it like it does without any project specified - throw an error.
Versions
package | version |
---|---|
@typescript-eslint/typescript-estree |
1.12.0 |
TypeScript |
3.5.3 |
node |
12.1.0 |
npm |
6.9.0 |