How to install Airbnb EsLint easily And Vim configure.
Guide to install EsLint, EsFormatter and scrooloose/syntastic.
1 min readAug 4, 2016
EsLint with Airbnb installation.
- Download script files above.
- run script install_eslint (script is run NPM install -g with sudo).
- run script gen_eslintrc.sh PATH (path must be your root project you wanna use EsLint.) run it always you create new project to use EsLint.
- Now you can use command line. eslint *.js, And esformatter *.js to test it.
- done.
VIM
- scrooloose/syntastic https://github.com/scrooloose/syntastic
- vim-esformatter (if u run script install_eslint, esformatter installed) https://github.com/millermedeiros/vim-esformatter
Installation with Vundle
Recommend configure for Syntastic
Recommend configure for EsFormatter
Modify configure EsFormatter for match to Airbnb
I found some wrong space when formatting.
Such as Destructuring.
const {firstName, lastName} = user;
Should be has spaces.
const { firstName, lastName } = user;
I fixed it with change some default config file.
sudo vi /usr/local/lib/node_modules/esformatter/lib/preset/default.json