0.0.1 • Published 3 years ago

@teslao/eslint-config-rax v0.0.1

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
3 years ago

安装

npm install eslint-config-rax

依赖的库有:

  // 基础依赖
  "babel-eslint": "^10.0.1"
  "eslint": "^5.16.0"
  "eslint-plugin-import": "^2.17.2"
  // 使用Typescript时依赖
  "@typescript-eslint/eslint-plugin": "^1.7.0"
  "@typescript-eslint/parser": "^1.7.0"
  "typescript": "^3.4.5"
  // 使用React时依赖
  "eslint-plugin-react": "^7.12.4"

使用

设置 .eslintrc.js 内容如下:

规则定义说明

修改规则

若修改增添规则,请提供规则的用处和理由

比如:

    /**
     * Indent is replaced by two Spaces
     * @reason Conventional convention
    */
    "indent": "off",
    '@typescript-eslint/indent': [
      'error',
      2,
      {
        SwitchCase: 1,
        flatTernaryExpressions: true
      }
    ],