В settings.json добавить правило
"eslint.workingDirectories": [{
"directory": "/path/to/directory/with/eslintrc_file",
"changeProcessCWD": true
},],
Выдержка из доки по поводу данной настройки:
"eslint.workingDirectories": [ "./client", // changeProcessCWD defaults to false { "directory": "./server", "changeProcessCWD": true } ]In the above example,
client.jswill be evaluated fromrootusingroot/client/.eslintrc.json,
whileserver.jswill be evaluated fromroot/serverusingroot/server/.eslintrc.json
UsingchangeProcessCWDcauses vscode-eslint to change the current working directory of the eslint process todirectoryas well. This is often necessary if ESLint is used to validate relative import statements likeimport A from 'components/A';which would otherwise be resolved to the workspace folder root.
Top comments (0)