-
Notifications
You must be signed in to change notification settings - Fork 176
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
The plugin can't find eslint even though it is in PATH #233
Comments
ESLint is a weird one. I did not implement support for it, and do not use it myself either. |
Since this is related, I won't open a new issue. The automatter also can't find eslint on my system when it's installed globally.
@opennota I may tackle this issue later if you don't get to it before me. For now I've just symlinked |
I've submitted PR #243 which fixes this problem. It simplifies some of the logic and makes allows the formatter to run even if there is no |
The old formatdef for eslint could not correctly locate the binary for eslint installed via `sudo npm -g install eslint`. It would also not work if a `eslintrc.*` file did not exist. This simple patch makes the formatter fall back on using the $PATH to locate `eslint` if it is not a locally installed node_module, allows the formatter to run with the --no-eslintrc option if no config file can be found, and simplifies some of the logic where the formatter attempts to find the config files. Patch tested with `vim` 8.0 compiled for Fedora 28 Workstation
I've downloaded and unpacked node.js into
$HOME/node/
, and have added$HOME/node/bin/
to PATH. Then I have installed eslint:npm -g install eslint
. Even though I can now invoke eslint from the command line, vim-autoformat can't find it (it only looks innode_modules/.bin/
,~/.npm-global/bin/
and/usr/local/bin/
).It would be nice if vim-autoformat didn't just look for formatters in the hard-coded locations.
The text was updated successfully, but these errors were encountered: