Dealing with "Failed to load plugin 'react' declared in '.eslintrc': Cannot find module 'eslint-plugin-react'" ESLint error
I had the same problem in VS code. Add the following settings in VS code ESLint settings:
{
"eslint.workingDirectories": [
"Dir1",
"Dir2"
],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
]
}
Note: Dir1 and Dir2 are two directories with their respective .eslintrc files.