I am using the ESLint plugin by Dirk Baeumer in Visual Studio Code.
My project is large and complex and divided into several primary directories. Each directory has its own package.json file, its own node_modules
directory and its own version of eslint.
How do I configure the ESLint plugin to respect the eslint version used in each directory? I think it has something to do with the eslint.workingDirectories
setting, but I don't understand how to use it properly.
Further information:
My project workspace has two directories, "folder1" and "folder2". The directory structure looks something like this:
folder1
.eslintrc.json -- rules for the entire "folder1" project to follow
build
platform
core
Makefile
core-v1
.eslintrc.json
Makefile
package.json -- eslint v4
node_modules
core-v2
.eslintrc.json
Makefile
package.json -- eslint v6
node_modules
folder2
My workspace configuration file includes:
"eslint.workingDirectories": [
"./folder1/core/core-v1",
"./folder1/core/core-v2"
]
This seems to produce the following error, and no linting errors are detected or highlighted:
Uncaught exception received.
Error: spawn /Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Renderer).app/Contents/MacOS/Code - Insiders Helper (Renderer) ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
How do I configure the ESLint plugin to use eslint v4 for files in "folder1/core/core-v1" and v6 for files in "folder1/core/core-v2"? My build process runs separate scripts for these directories, but my editor (VS Code) is trying to use a either v4 or v6 to lint all of the files in my project.