Update readme and vim error messages for eslint global support
This commit is contained in:
parent
5ea2893299
commit
ab7ead0c3f
10
README.md
10
README.md
@ -162,11 +162,11 @@ Here is a list of formatprograms that are supported by default, and thus will be
|
||||
It can be installed by running `npm install -g standard` (`nodejs` is required). No more configuration needed.
|
||||
More information about the style guide can be found here: http://standardjs.com/.
|
||||
|
||||
* `ESlint (local)` for __Javascript__. http://eslint.org/
|
||||
It can be installed by running `npm install eslint`. The linter is then installed locally at ```node_modules/.bin/eslint```
|
||||
When running formatter vim will walk up from the current file to search for such local installation and a
|
||||
ESLint configuration file (either .eslintrc or eslintrc.json). When both are found eslint is executed with the --fix argument.
|
||||
Currently only working on *nix like OS (Linux, MacOS etc.) requires OS to provide sh like shell syntax
|
||||
* `ESlint (support local&global)` for __Javascript__. http://eslint.org/
|
||||
It can be installed by running `npm install eslint` for local project or by running `npm install -g eslint` for global use. The linter is then installed locally at `$YOUR_PROJECT/node_modules/.bin/eslint` for local or `~/.npm-global/bin/eslint` for global.
|
||||
When running formatter vim will walk up from the current file to search for such local installation and a ESLint configuration file (either .eslintrc.js or eslintrc.json). When local version is missing it will fallback to global version. When both requirements are found eslint is executed with the --fix argument.
|
||||
Note that the formatter's name is still `eslint_local` for legacy reason while it has already support global `eslint`.
|
||||
Currently only working on \*nix like OS (Linux, MacOS etc.) requires OS to provide sh like shell syntax
|
||||
|
||||
* `xo` for __Javascript__.
|
||||
It can be installed by running `npm install -g xo` (`nodejs` is required).
|
||||
|
@ -181,7 +181,7 @@ if !exists('g:formatdef_eslint_local')
|
||||
let l:path = fnamemodify(expand('%'), ':p')
|
||||
let verbose = &verbose || g:autoformat_verbosemode == 1
|
||||
if has('win32')
|
||||
return "(>&2 echo 'ESLint Local not supported on win32')"
|
||||
return "(>&2 echo 'ESLint not supported on win32')"
|
||||
endif
|
||||
" find formatter & config file
|
||||
let l:prog = findfile('node_modules/.bin/eslint', l:path.";")
|
||||
@ -218,7 +218,7 @@ if !exists('g:formatdef_eslint_local')
|
||||
endif
|
||||
if (empty(l:cfg) || empty(l:prog))
|
||||
if verbose
|
||||
return "(>&2 echo 'No local ESLint program and/or config found')"
|
||||
return "(>&2 echo 'No local&global ESLint program and/or config found')"
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user