All Posts Tagged “linter”

Python Linters

ESLint

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

ref:
http://eslint.org/

Install

$ npm install eslint eslint-config-airbnb --save-dev

It's convenient to use the ESLint plugin from Airbnb instead of configurating your own preferences.
https://github.com/airbnb/javascript/tree/master/linters

Configuration

in .eslintrc

{
  "env": {
    "browser": true,
    "es6": true,
    "mocha": true,
    "node": true
  },
  "extends": ["airbnb/base"],
  "rules": {
    "curly": 2,
    "indent": [2, 2],
    "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.

ref:
http://eslint.org/docs/user-guide/configuring
http://eslint.org/docs/rules/