自分の作ってるNode.jsの練習用WebアプリケーションをES6に対応させようとしているのでついでにESLintを入れてみた。
Ruleを見ると1つ1つ見るのは疲れるので、airbnbをベースにしていくつか自分のスタイルに合わないところをrulesに加えた。
{
// see https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
"extends": "airbnb/base",
"env": {
"browser": true,
"node": true,
"mocha": true,
"es6": true,
},
"rules": {
"strict": 0, // use strictは許可 http://eslint.org/docs/rules/strict
"func-names": 0, // 無名関数は許可 http://eslint.org/docs/rules/func-names
"space-before-function-paren":0, // functionの前にスペースは許可 http://eslint.org/docs/rules/space-before-function-paren
"id-length": [2, {"min":2, "properties": "never", "exceptions": ["_", "e", "i", "j", "k", "x", "y", "z"]}], // http://eslint.org/docs/rules/id-length
"indent":[2, 2, {"SwitchCase": 1}], // http://eslint.org/docs/rules/indent
"callback-return":2 , // http://eslint.org/docs/rules/callback-return
"handle-callback-err":2, // http://eslint.org/docs/rules/handle-callback-err
"no-param-reassign":0, // http://eslint.org/docs/rules/no-param-reassign
"no-cond-assign": [2, "except-parens"], // http://eslint.org/docs/rules/no-cond-assign
"arrow-parens": [2, "always"], // http://eslint.org/docs/rules/arrow-parens
}
}