xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

ESLint All In One

ESLint All In One

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

https://www.cnblogs.com/xgqfrms/p/11843237.html

refs

https://eslint.org/docs/user-guide/getting-started

https://cn.eslint.org/docs/user-guide/getting-started

https://www.youtube.com/watch?v=hppJw2REb8g&feature=youtu.be



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-08-31 18:19  xgqfrms  阅读(209)  评论(3编辑  收藏  举报