Closed affanmustafa closed 1 year ago
move extends
from root to overrides, and remove slash in parserOptions.project
in apps/eslint
ex: https://github.com/FahriDevZ/nx-eslint/commit/f8af4038a3cd0715afe690eb6c179c9b89516216
I am closing this as answered by @FahriDevZ.
.eslintrc.json
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
//...
},
{
"files": ["*.ts", "*.tsx"],
"extends": [
"airbnb-typescript/base", // moved from top
"plugin:@nrwl/nx/typescript"
],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
//...
}
]
}
apps/eslint/.eslintrc.json
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["apps/eslint/tsconfig.*?.json"] // drop leading slash here
},
//...
},
{
"files": ["*.html"],
//...
}
]
}
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
In case of type-checking, as per the NX documents (https://nx.dev/recipes/other/eslint) you must add
parserOptions.project
in the corresponding overrides block. That seems to work for NestJS in my monorepo but not for Angular. I have the basiceslintrc.json
for root, api and eslint. I am only adding this at the top of the root eslintrc.json:After that, my
root
eslintrc.json looks like this:And my
api
eslintrc.json looks like this:And finally, the
eslint
eslintrc.json looks like this:As per this,
nx lint api
works fine however,nx lint eslint
gives the errorwhich is not fixed even after adding
parserOptions.project
.Expected Behavior
After adding
parserOptions.project
linting should work fine.Github Repo
https://github.com/affanmustafa/nx-eslint
Steps to Reproduce
nx lint api
nx lint eslint
eslintrc.json
haveparserOptions.project
configured.Nx Report
Failure Logs
No response
Additional Information
No response