What code were you trying to parse?
New files added to the project
What did you expect to happen?
ESLint works
What actually happened?
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: src/ui/components/core/DragHandle/DragHandle.tsx.
The file must be included in at least one of the projects provided.
Versions
| package |
version |
@typescript-eslint/parser |
2.10.0 |
TypeScript |
3.7.4 |
ESLint |
6.7.2 |
node |
12.8.0 |
npm |
6.13.4 |
.eslintrc.js
module.exports = {
plugins: ["import"],
extends: ["react-app", "plugin:import/errors", "plugin:import/warnings", "plugin:import/typescript", "prettier"],
parserOptions: {
project: "./tsconfig.eslint.json",
},
rules: {
"import/default": "off", // not working with TS right now for export = (https://github.com/benmosher/eslint-plugin-import/issues/1527)
"import/named": "off", // not needed with TS.
"import/namespace": "off", // not needed with TS.
"import/no-cycle": "off", // takes long, using madge for this
"import/no-internal-modules": "off",
"import/order": [
"error",
{
"newlines-between": "always",
},
],
"no-shadow": ["error"],
"prefer-const": [
"warn",
{
destructuring: "all",
},
],
"require-await": "off",
},
overrides: [
{
files: ["**/*.ts?(x)"],
rules: {
"@typescript-eslint/ban-ts-ignore": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/interface-name-prefix": [
"warn",
{
prefixWithI: "always",
allowUnderscorePrefix: false,
},
],
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/require-await": "warn",
},
},
],
settings: {
"import/extesions": [".js", ".ts", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
},
tsconfig.eslint.json
{
"extends": "./tsconfig",
"include": ["./**/*", "./.storybook/**/*"],
"exclude": ["assets", "build", "build-resources", "node_modules", "tmp"]
}
tsconfig.json
{
"compilerOptions": {
"target": "es6",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"downlevelIteration": true,
"sourceMap": true
},
"include": ["src"],
"exclude": ["src/electron"]
}
.env (for create-react-app)
The only fix this to restart the ESLint process in IntelliJ. Once it's restarted, eslint works just fine on all files in src no matter how deeply nested. As soon as I create a new file it comes back.
Looks related to #1303 (comment)
What code were you trying to parse?
New files added to the project
What did you expect to happen?
ESLint works
What actually happened?
Versions
@typescript-eslint/parser2.10.0TypeScript3.7.4ESLint6.7.2node12.8.0npm6.13.4.eslintrc.jstsconfig.eslint.json{ "extends": "./tsconfig", "include": ["./**/*", "./.storybook/**/*"], "exclude": ["assets", "build", "build-resources", "node_modules", "tmp"] }tsconfig.json{ "compilerOptions": { "target": "es6", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": false, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "preserve", "downlevelIteration": true, "sourceMap": true }, "include": ["src"], "exclude": ["src/electron"] }.env(for create-react-app)The only fix this to restart the ESLint process in IntelliJ. Once it's restarted, eslint works just fine on all files in
srcno matter how deeply nested. As soon as I create a new file it comes back.Looks related to #1303 (comment)