ESLint error: Cannot read file '.../tsconfig.json' — how to fix?
Hi! I'm new to TypeScript and trying to set up linting in my project. I installed ESLint, typescript-eslint, and created a `.eslintrc.json` config. But when I run ESLint, I get the following error:
```
Parsing error: Cannot read file '.../tsconfig.json'.eslint
```
Here is my `.eslintrc.json` file:
```json
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
]
}
```
And my `tsconfig.json` is in the project root:
```json
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"strict": true,
"outDir": "./dist"
},
"include": ["src/**/*"]
}
```
Folder structure:
```
my-project/
├── .eslintrc.json
├── tsconfig.json
├── src/
│ └── index.ts
└── package.json
```
I checked that the `tsconfig.json` file exists and is in the root. What am I doing wrong?
No answers yet.
Log in to leave an answer
Blogs