Commit ba44647
Fix VS Code integration when ESLint project outside VS Code project
When an ESLint project is not in the root directory, e.g.
+ our-project
|--+ client
| |--- src/
| |--- package.json
| |--- eslint-local-rules.js
|--+ server
| |--- stuff
Some editor plugins does not `cd` into `client` directory when invoking
ESLint. Therefore `process.cwd()` is "our-project", which means `requireUp`
will not find our "eslint-local-rules.js".
This problem is fixed by making this plugin require from `__dirname` instead
of `process.cwd()`. Intuitively, the behavior of the plugin should not depend
on where it is run.
This commit also makes `eslint-plugin-local-rules` fail loudly if the rules
file is not found.1 parent fc46d2e commit ba44647
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
| |||
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
16 | | - | |
17 | 24 | | |
18 | 25 | | |
19 | 26 | | |
| |||
0 commit comments