Parsing error: File 'tsconfig.json' not found - if project does not contain tsconfig.json in workspace root
See original GitHub issueI have a project (repo link) that has two separate tsconfig files in non-root folders. When I open this project in VScode, the linter gives this error in every TS file:
Parsing error: File '/project-root/tsconfig.json' not found.
That path indeed does not link to an existing file, since it should look in a specific subdirectory of project-root
.
Whenever I open one of the subfolders, the error goes away and the plugin functions as expected.
Possibly related to #691
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:11 (3 by maintainers)
Top Results From Across the Web
214 - Stack Overflow
To fix this, you can set tsconfigRootDir to __dirname , which would make the parser resolve the project configuration relative to .eslintrc.js :...
Read more >Parsing Error: Cannot read file 'tsconfig.json' | bobbyhadz
If the error "Parsing Error: Cannot read file 'tsconfig.json'" is still not resolved and you use the VSCode IDE, create a .vscode folder...
Read more >Options - TypeDoc
Specify a tsconfig.json file that options should be read from. If not specified TypeDoc will look for tsconfig.json in the current directory and...
Read more >WebStorm incorrectly builds the path to eslint's parserOptions ...
Set up a project with Typescript files and tsconfig.json in the /server directory. Add .eslintrc.js file to the ... ESLint: Parsing error: Cannot...
Read more >Tasks in Visual Studio Code
Create an empty folder "mytask", generate a tsconfig.json file and start VS Code from ... Not all tasks or scripts can be auto-detected...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@joepio I mean running it in the workspace folder. Something like
eslint --ext .js,.jsx,.ts,.tsx ./front/src
Have you tried to add the following configuration to tell eslint what your working directories are:
Closing the issue then.