Skip to content

Instantly share code, notes, and snippets.

@honewatson
Created March 2, 2016 02:40
Show Gist options
  • Save honewatson/fdcfefb49093a126ab00 to your computer and use it in GitHub Desktop.
Save honewatson/fdcfefb49093a126ab00 to your computer and use it in GitHub Desktop.
Eslint Example For Vim with es6 babel-eslint parser
// Eslint npm install eslint-plugin-babel -D && ln -s node_modules/eslint/bin/eslint.js eslint
// Also the dependency for .vimrc
/*
let g:syntastic_javascript_checkers = ['eslint']
" Override eslint with local version where necessary.
let local_eslint = finddir('node_modules', '.;') . '/.bin/eslint'
if matchstr(local_eslint, "^\/\\w") == ''
let local_eslint = getcwd() . "/" . local_eslint
endif
if executable(local_eslint)
let g:syntastic_javascript_eslint_exec = local_eslint
endif
*/
{
"ecmaFeatures": {
"jsx": true,
"modules": true,
"templateStrings": true
},
"env": {
"browser": true,
"node": true
},
"parser": "babel-eslint",
"rules": {
"quotes": [2, "single"],
"strict": [2, "never"],
"babel/generator-star-spacing": 1,
"babel/new-cap": 1,
"babel/object-shorthand": 1,
"babel/arrow-parens": 1,
"babel/no-await-in-loop": 1,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/react-in-jsx-scope": 2
},
"plugins": [
"babel",
"react"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment