question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing error: File 'tsconfig.json' not found - if project does not contain tsconfig.json in workspace root

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dbaeumercommented, Aug 8, 2019

@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:

  "eslint.workingDirectories": [
    { "directory": "front", "changeProcessCWD": true },
    { "directory": "server", "changeProcessCWD": true }
  ]

0reactions
dbaeumercommented, Aug 8, 2019

Closing the issue then.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found