I have a typescript project, I use @typescript-eslint/parser
and @typescript-eslint/eslint-plugin
to lint it.
It seems eslint
couldn't recognize undefined
in my project. The error message is:
Variable 'undefined' implicitly has an 'any' type.ts(7005)
I have searched on the internet but got nothing.
Have you ever got the same problem?
CodePudding user response:
Could you try to add the line below to tsconfig.ts
?:
"noImplicitAny": false
CodePudding user response:
I found two ways to resolve it:
npm i @types/node --save-dev
"lib": ["esnext", "DOM"]
in tsconfig.json
You don't need to do both of them.