ESLint: a pluggable and extensible linter for JavaScript

ESLint is a pluggable and extensible linter for JavaScript, supports ECMAScript 6 perfectly.



$ npm install \
eslint \
eslint-plugin-import \
eslint-config-airbnb-base \

It's convenient to use the ESLint plugin from Airbnb instead of configurating your own preferences.


// .eslintrc
  "extends": ["airbnb-base"],
  "env": {
    "browser": true,
    "es6": true,
    "mocha": true,
    "node": true,
    "shared-node-browser": true
  "rules": {
    "class-methods-use-this": 0,
    "curly": 2,
    "indent": [2, 2],
    "max-len": 0,
    "no-continue": 0,
    "no-plusplus": ["error", {"allowForLoopAfterthoughts": true}],
    "no-useless-escape": 0,
    "object-curly-spacing": 0,
    "quote-props": 0,
    "quotes": [1, "single"]

You should put a .eslintrc in your project root as the global linting settings, also you can put a .eslintrc in any subfolders to specialize linting configurations.