I have a file structure which looks like this:
-- folder1
-- folder2
-- folder3
-- client
|-- **
|-- .eslintrc (1)
-- .eslintrc (2)
The ESLint plugin in vscode
only detects the (2) .eslintrc. I have set the working directory to `"./client". Can anyone tell me what am I doing wrong? The (1) eslintrc file is supposed to add extra rules for client code.
I have a file structure which looks like this:
-- folder1
-- folder2
-- folder3
-- client
|-- **
|-- .eslintrc (1)
-- .eslintrc (2)
The ESLint plugin in vscode
only detects the (2) .eslintrc. I have set the working directory to `"./client". Can anyone tell me what am I doing wrong? The (1) eslintrc file is supposed to add extra rules for client code.
- i believe this is you're answer – Zakaria Mansouri Commented Jan 5, 2018 at 21:17
1 Answer
Reset to default 15Add "root": true
to your .eslintrc
in your client directory.
From similar question and its answer: https://stackoverflow./a/37490224/1766230
You can add
root: true
to the top of any config to stop ESLint from searching parent folders for config files. So you should update your.eslintrc
and add top level property"root": true
.
From the docs: https://eslint/docs/user-guide/configuring#using-configuration-files-1
ESLint will automatically look for them in the directory of the file to be linted, and in successive parent directories all the way up to the root directory of the filesystem (unless root: true is specified). This option is useful when you want different configurations for different parts of a project or when you want others to be able to use ESLint directly without needing to remember to pass in the configuration file.