-
Notifications
You must be signed in to change notification settings - Fork 141
Change for relative path algorithm #1338
Comments
How are you running |
Hehe... Well, though personal configs are deprecated, the ability to have linting in HOME is thankfully not (I have my repos within HOME). I like to take a config I have in HOME (normally named I don't do this normally since there can be subtle conflicts in allowing projects to be combined with one's own rules, and in the course of normal work, the project's linting has priority anyways. However, adding my own personal config to the mix can be useful toward enforcing stricter standards than a project might be willing to adopt (though where the project is not against fixes inspired by such rules), especially when either confining oneself to few HOME rules or adding project-specific I therefore have As far as the ignore file in HOME, I use that so that I can add back files which a project does not lint by the While I am aware that I could point to a non-HOME RC file elsewhere with
(Note that since a project can override the HOME (or use So in summary, though it can require some work to set things up, I don't think it is too obscure to want to be able to check other projects in a stricter manner than the project's current config allows, especially if one is not motivated to make one's own fork. The fix I provided too shouldn't be too obtrusive either I would think. Thanks! |
This problem of relative paths is also present for monorepos. Maybe This is what webstorm just did recently
|
Issue Type
Issue Description
I have some ESLint in my HOME, with its own
.eslintignore
,node_modules
(includingeslint
copy), etc.In one project, I did not have an
.eslintignore
. This causedgetRelativePath
ofsrc/worker-helpers.js
to look up in a higher directory (here, HOME) and finding an ignore file there, set that as the cwd (e.g., for eslint).The ignore files are not what eslint itself looks at for determining hierarchy, though I understand per a note in source that you use the position of the ignore file (rather than using a config file which may be present at different paths within the project hierarchy) as the project root:
However, perhaps the result of
findCached
could be checked to make sure it is not at a higher directory than the project path.The following change seems to have fixed it:
Changing the following line from
getRelativePath
:...to:
Bug Checklist
eslint
CLI gives the proper result, whilelinter-eslint
does notLinter Eslint: Debug
command from the Command Palette below(I got the following message, as my HOME eslint plugin copy was outdated, but I wasn't expecting it to use the HOME config since I didn't specify that as my config)
The text was updated successfully, but these errors were encountered: