ESLint All In One Airbnb eslint ignore .eslintignore
ESLint
$ yarn add -D eslint
.eslintrc.{js,yml,json}
优先级
.eslintrc
.eslintrc.js
.eslintrc.yml
.eslintrc.json
{
// "extends": "airbnb",
"extends": "eslint:recommended",
"rules": {
"semi": ["error", "always"],
"quotes": ["error", "double"],
"no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }],
"no-console": 0,
"linebreak-style": ["error", "unix"],
"no-use-before-define": ["off"],
"comma-dangle": ["error", "never"],
"global-require": ["off"],
"import/no-dynamic-require": ["off"]
},
"env": {
"browser": false,
"es6": true,
"node": true
}
}
level
"off" 或 0 - 关闭规则
"warn" 或 1 - 警告
"error" 或 2 - 错误
eslint ignore
.eslintignore