{
  "extends": [
    "airbnb-base",
    "plugin:@typescript-eslint/recommended"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "tsconfig.json"
  },
  "plugins": [
    "@typescript-eslint",
    "eslint-plugin-import",
    "eslint-plugin-eslint-comments",
    "eslint-plugin-jsdoc"
  ],
  "env": {
    "node": true,
    "jest": true
  },
  "rules": {
    "no-console": "off",

    // 有大量对未暴露出来的属性做 hack
    // 需要使用 (res as any)._send = () => {} 的方式
    "no-underscore-dangle": "off",
    "@typescript-eslint/no-explicit-any": "off",
    "no-param-reassign": "off",

    "max-len": ["error", { "code": 80, "ignoreComments": true }],

    // 不要求对 import 进行排序
    "import/order": "off",

    "import/no-mutable-exports": "off",

    "import/prefer-default-export": "off",

    // 不要求 import 的模块一定要存在, 因为有自定义的 resolve 和 alias
    "import/no-unresolved": "off",

    // 使用双引号
    "quotes": ["error", "double"],

    // 禁止多余的逗号
    "comma-dangle": ["error", "never"],

    // 强制要求类成员之间要保留空行, 但允许单行类成员声明之间没有空行
    "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],

    // 强制要求多行代码块只有要保留空行
    "padding-line-between-statements": [
      "error",
      { "blankLine": "always", "prev": "class", "next": "*" },
      { "blankLine": "always", "prev": "function", "next": "*" },
      { "blankLine": "always", "prev": "iife", "next": "*" },
      { "blankLine": "always", "prev": "multiline-block-like", "next": "*" },
      { "blankLine": "always", "prev": "multiline-expression", "next": "*" }
    ],

    // 不允许使用 @deprecated 的变量或函数
    "import/no-deprecated": "error",

    // jsdoc @param 的名字和顺序必须和定义的一致
    "jsdoc/check-param-names": "error",

    // jsdoc 中 @ 开头的 tag 名称必须符合规范
    "jsdoc/check-tag-names": "error",

    // 不允许出现未使用的 eslint-disable
    "eslint-comments/no-unused-disable": "error",

    // 允许空箭头函数
    "@typescript-eslint/no-empty-function": [
      "error", 
      { "allow": ["arrowFunctions"] }
    ],

    // 允许 import 文件时缺失后缀
    "import/extensions": "off"
  }
}
