Confirmed users
100
edits
(Update ESLint version) |
(Add section on using ESLint with ViM) |
||
| Line 113: | Line 113: | ||
[[File:Eslint-atom.png|600px|ESLint in Atom]] | [[File:Eslint-atom.png|600px|ESLint in Atom]] | ||
=== Running ESLint in ViM === | |||
If you don't use Syntastic yet, the instructions here should get you started: https://wiki.mozilla.org/WebExtensions/Hacking#Vim | |||
Alternatively, if you do use Syntastic already, add this to your <code>.vimrc</code> to get ESLint working where the path contains <code>mozilla-central</code> (adjust the path to reflect the one in your computer): | |||
<code> | |||
autocmd FileType javascript,html | |||
\ if stridx(expand("%:p"), "/mozilla-central/") != -1 | | |||
\ let b:syntastic_checkers = ['eslint'] | | |||
\ let b:syntastic_eslint_exec = '/path/to/mozilla-central/tools/lint/eslint/node_modules/.bin/eslint' | | |||
\ let b:syntastic_html_eslint_args = ['--plugin', 'html'] | | |||
\ endif | |||
</code> | |||
You probably need to close and reopen ViM for the changes to take effect. Then, open any file and try to edit it to cause an error, then save it. If all goes well, you will get some distinctive arrows pointing to the error. Hovering with the mouse will produce a sort of tooltip with more information about the error. | |||
=== Getting Rid of ESLint Errors === | === Getting Rid of ESLint Errors === | ||