ESLint on steroids with Airbnb + Standard JS styles

ESLint is a tool which helps you to write perfect JavaScript. Now it is easy to install it feature packed with best style configs out there: Airbnb Style Guide + JavaScript Standard Style.
See airbnb/javascript and standardjs for more information. Compare configs.
Just install eslint-config-airbnb-standard npm module globally:
npm install --global eslint-config-airbnb-standard
And now you can use supernormal ESLint from anywhere:
eslint -v
eslint app.js
Don’t forget to create .eslintrc
file in your project. Also setup your IDE / Editor to fix your styles on the fly!
ES6, ES7, React, JSX, async/await — all new features supported by default 👍
Local installation is also appropriate. Install the module with --save-dev
flag and use npx tool to run local ESLint: npx eslint -v
You can also find instructions for Atom and WebStorm.
How to use it in Sublime Text 3?
- Install the package
npm i -g eslint-config-airbnb-standard
- Go to: Preferences -> Package Control -> install package
- Install SublimeLinter
- Install SublimeLinter-contrib-eslint
- Run
npm bin -g
… and copy the path - Go to: Tools -> SublimeLinter -> Open User Settings
- Paste the path (nodejs global bin folder) inside “paths” for your OS, for example:
"paths": {
"linux": [
"~/.nvm/versions/node/v8.1.2/bin"
],
"osx": [],
"windows": [
"%AppData%\\npm"
]
},
8. Create .eslintrc
file inside your working project:
{
"extends": ["airbnb-standard"]
}
9. Restart Sublime Text
10. Have fun!
What if I want to turn off semicolons?
You can turn off semicolons in .eslintrc
(semi -> "never") for your project:
{
"extends": ["airbnb-standard"],
"rules": {
"semi": [2, "never"],
"object-curly-spacing": [2, "never"]
}
}
Good luck on your coding!