arch only seems to use eslint, but I haven't been able to set it up to use a local copy of eslint. according to 'something I read somewhere', eslint is best used locally, it can be problematic if a global copy is used. Using local means having it in package.json, npm init and eslint init. Older documents refer to using 'npm run eslint', newer docs refer to 'npx eslint'.
I am able to run this from the shell, 'npx eslint myfile.js' but never from vim nor atom. Only by installing eslint globally have I been successful.
- 'npm -g install eslint'
- 'npx eslint init' This creates .eslint.rc n the current directory. If there is no such a file, eslint will look for it in the user's home directory, so best to create one there as a backup.
- in eslint.rc, set tabs to be 2 instead of 4
- use plugin pangloss/vim-javascript
- let g:syntastic_javascript_checkers = ['eslint'] In vim, run ':SyntasticInfo' to see which linters are being used.
What 'ought to happen' is
- 'npm install eslint' to install eslint,
- 'npx eslint init' to create eslint.rc and package.json
- use plugin pangloss/vim-javascript
- let g:syntastic_javascript_checkers = ['eslint'] let g:syntastic_javascript_eslint_exe = 'npx elsint'
eslint_exe is not a typo, read help syntastic-checkers-javascript