I have followed this guide to set up .eslintrc
configuration.
I have also enabled ESLint in Visual Studio by following this guide:
https://stackoverflow.com/a/44458832/3850405
My problem is that I want to use a project specific config instead of the Global ESLint Config.
The guide sets up a .eslintrc.js
file so I tried to switch to a file that had the same structure as C:\Users\Oscar\.eslintrc
.
Tried placing the .eslintrc
in the root folder of the solution, project and in my ClientApp
folder but nothing got picked up. Is it possible to use a project specific ESLint config in Visual Studio and receive build errors/warnings?
Running the command npx eslint . --ext .js,.jsx,.ts,.tsx
gives me correct errors but Visual Studio shows no errors.
.eslintrc
:
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"jest"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:react/recommended"
],
"env": {
"browser": true,
"node": true,
"jest/globals": true
},
"rules": {
"no-console": [
"error",
{ "allow": [ "warn", "error" ] }
]
}
}