-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packageDir should be relative to eslint config file not cwd #1061
Comments
That seems like an issue with "ale"; you'll always want to set your CWD as the package root no matter where you opened vim from. It might be a bug/feature request to file with them? Do you get the same issue when running eslint on the command line? If not, it's not an issue with this plugin. |
I have a similar issue with SublimeLinter. |
@oblador how are you opening your project in sublime? |
Yes, the problem occurs on the commandline as well:
|
Thanks, that clarifies things a bit. Possibly related to #458 but this sounds different. |
One thing that could be considered would be adding an extra option for making the |
sounds like much better behavior. I think this would qualify as semver-major breaking change though, FWIW. IIRC one workaround is to define your ESLint config as JS and use |
can anyone confirm how to read the eslint config file's location? last I knew, this is not info that is accessible in the plugin. if it is not possible, will have to close with the resolution to use the workaround I stated above. also, I just read @w0rp's suggestion to use a flag to route relative to config file. If it's possible to do, will consider as a short-term semver-minor change but I think I'd still want to make it the default behavior in the next major version. |
I don’t believe there is; config can come from multiple locations, including inline comments, and be merged upwards as well - so there may not be any config file locations, or there may be more than one. |
I think using |
closed by adding a note to docs. thanks all! |
I'm using https://github.com/w0rp/ale to run eslint inside vim but packageDir seems to be resolved relative to where I start vim instead of where the eslint config file is. So if I have the rule
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }]
and dovim src/index.js
everything works as expected, but if I docd src; vim index.js
I getimport/no-extraneous-dependencies: The package.json file could not be found.
The text was updated successfully, but these errors were encountered: