'Eslint Typescript "No Implicit Any" rule
I am setting up a new typescript project with eslint. I am trying to setup eslint rules correctly so that the tsc command runs without errors. I have the problem with the "noImplicitAny" rule, which I use in tsconfig.json, but I am unable check for this in eslint.
.eslintrc.js:
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["tsconfig.json"],
sourceType: "module",
},
rules: {
"no-undef": "warn",
},
plugins: ["@typescript-eslint"],
settings: {
"import/resolver": {
node: {
extensions: [".js", ".ts"],
},
},
},
};
tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "ES6",
"declaration": true,
"outDir": "./lib",
"strict": true,
"noImplicitAny": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "**/__tests__/*"]
}
In short I want the eslint to check for the implicit any and warn about its usage. How can I configure the rules in .eslintrc.js to achieve this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
