Ale: Unable to configure ale to use eslint - reverts to jshint instead (MacVim 8.0 112)

Created on 17 Oct 2016  路  12Comments  路  Source: dense-analysis/ale

As per the title.

I've been trying various incantations such as: let g:ale_linters = {'javascript': ['eslint']} but to no avail; each time it either uses jshint or, if I break it, nothing.

What I've tried

  • let g:ale_linters = {'javascript': []} also uses jshint. We'd expect it to use nothing
  • let g:ale_linters = {'javascript': ['jscs']} also uses jshint
  • let g:ale_linter_aliases = {'javascript.jsx': 'javascript', 'jsx': 'javascript'}
  • Setting the executable as per let g:ale_javascript_eslint_executable = '/foo/blah.../node_modules/.bin/eslint'
bug

Most helpful comment

ALE should now support a version of eslint installed from your node_modules directory. If you install a version of eslint for your project, then that version will be used instead of the global eslint version. If you want to keep using the global version, you can set g:ale_javascript_eslint_use_global to 1. For NVM installed programs, you just have to set g:ale_javascript_eslint_executable to the right path, as always.

This should fix the issues above, so I will close this now.

All 12 comments

Try installing eslint globally with npm install -g eslint instead. There's no support at the moment for using the version of eslint from node_modules. Support hasn't been written for that yet.

Thanks. That's actually what I started with before trying to aim for a specific binary in case it was that. No luck there either I'm afraid

i was writting a similar issue right now, are you using macvim?

MacVim 8.0 (112) installed via brew

Updating issue title.

Are you able to run eslint on your file through a regular Vim command like :!eslint --stdin < %?

That command has been very helpful. I suspect my issue is related to my eslint and babel install/config, and not ale. I'll investigate further tomorrow and confirm.

Any progress on this @JofArnold?

Sorry for not replying. I couldn't get to the bottom of it. I suspect it's because ale is reading the local eslintrc in my project but requires the globally-installed npm modules. In my case, my project eslintrc contains configurations which require lots of different plugins - few of which I wish to install globally. In the end rather than investigate further I switched to neomake and that's working fine, but hopefully these comments will help someone.

In my case, running :!eslint --stdin < % i saw that eslint command was not found, so I figure out that my eslint was installed through nvm (/Users/cesar/.nvm/versions/node/v4.3.2/bin/eslint) and my jshint was on /usr/local/bin/jshint, and my macvim was not be able to find that path under the .nvm, and on terminal worked fine, so i had to export my nvm $PATH to macvim could be able to find it, and worked.

This plugin does not yet support loading eslint from node_modules. Support for that is forthcoming.

ALE should now support a version of eslint installed from your node_modules directory. If you install a version of eslint for your project, then that version will be used instead of the global eslint version. If you want to keep using the global version, you can set g:ale_javascript_eslint_use_global to 1. For NVM installed programs, you just have to set g:ale_javascript_eslint_executable to the right path, as always.

This should fix the issues above, so I will close this now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trevordmiller picture trevordmiller  路  3Comments

garand picture garand  路  4Comments

lervag picture lervag  路  3Comments

janhellmich picture janhellmich  路  3Comments

chauncey-garrett picture chauncey-garrett  路  3Comments