I have the following project structure:
/root
/serviceA
/serviceB
/serviceC
/serviceD
Not all of the services are typescript / node based, so I want to avoid adding tsconfig into the root. Each service is setup as a complete unit with its own installation of eslint, ts, and own configuration.
Any ts
service I open VScode shows the following error:
Parsing error: Cannot read file '/users/{me}/dev/{root}/tsconfig.json'.
This is correct, as there is no such file, so how do I force vscode & eslint to use the individual services configuration files?
Edit your .eslintrc
file with:
module.exports = {
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
};
Source: https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-488538828
In .eslintrc
you can set the path to tsconfig.json
.
parserOptions : {
project: './tsconfig.json',
},
Here’s an example where it is just set for ts files
https://github.com/davidjbradshaw/eslint-config-auto/blob/master/rules/%40typescript-eslint/parser.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With