-
Notifications
You must be signed in to change notification settings - Fork 1
ESLint
uupaa edited this page Jun 10, 2017
·
5 revisions
npm i
を実行すると ESLint がインストールされます。
npm i
./node_modules/.bin/eslint --version --version
> v3.19.0
ESLint は JavaScript のエラーチェックを行うコマンドラインツールです。
npm run eslint [options] file.js [file.js...]
や
npm run eslit [options] dir
とタイプすることで、JavaScript ファイルのチェックを行います。
npm run eslint app/lib
npm run eslint app/lib/modules/foo/bar.js
チェックしたくないファイルは .eslintignore に記述し、ルールの定義は .eslintrc に記述します。
WebApp/2 を clone した直後の .eslintrc は以下のようになっており、 ES6 と ESModules を有効化しています。
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"extends": [
"eslint:recommended"
],
"rules": {
"strict": [0],
"no-new": [0],
"new-cap": [0],
"no-empty": [0],
"no-shadow": [0],
"camelcase": [0],
"key-spacing": [0],
"dot-notation": [0],
"comma-dangle": [0],
"no-console": [0],
"no-multi-str": [0],
"no-multi-spaces": [0],
"no-control-regex": [0],
"no-unused-vars": [1, { "vars": "all", "args": "after-used"} ],
"no-underscore-dangle": [0],
"no-use-before-define": [0],
"no-inner-declarations": [0]
},
"globals": {
"unescape": false,
"escape": false
}
}
- Install and Setup
- Devlopment (TODO)
- Distribution
- Deployment (TODO)
- Application Structure
- Idioms
- Troubleshooting
- Keywords