.eslintrc.json 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {
  2. "root": true,
  3. "env": {
  4. "node": true,
  5. "browser": true,
  6. "es2021": true
  7. },
  8. "parserOptions": {
  9. "ecmaVersion": "latest",
  10. "parser": "@typescript-eslint/parser",
  11. "sourceType": "module"
  12. },
  13. "extends": [
  14. "plugin:vue/vue3-recommended",
  15. "airbnb-base"
  16. ],
  17. "rules": {
  18. "import/prefer-default-export": "off",
  19. "no-use-before-define": "off",
  20. "no-console": 0, // 禁用打印
  21. "comma-dangle": [
  22. 2,
  23. "never"
  24. ], // 禁止使用拖尾逗号
  25. "no-extra-semi": 2, // 禁止不必要的分号
  26. "array-bracket-spacing": [
  27. 2,
  28. "always"
  29. ], // 指定数组的元素之间要以空格隔开
  30. "jsx-quotes": 0, // 强制使用单引号
  31. "max-len": 0, // 强制一行的最大长度
  32. "semi": [
  33. 2,
  34. "never"
  35. ], // 禁止使用分号
  36. "no-unused-vars": 0,
  37. "no-unneeded-ternary": 2, // 禁止不必要的嵌套 var isYes = answer === 1 ? true : false;
  38. "no-unreachable": 2, // 不能有无法执行的代码
  39. "no-unused-expressions": 1, // 禁止无用的表达式
  40. "linebreak-style": [
  41. 0,
  42. "error",
  43. "windows"
  44. ],
  45. "import/no-unresolved": 0,
  46. "import/extensions": 0,
  47. "import/no-absolute-path": 0,
  48. "import/no-extraneous-dependencies": [
  49. "error",
  50. {
  51. "devDependencies": true
  52. }
  53. ],
  54. "class-methods-use-this": 0,
  55. "no-mixed-operators": 0,
  56. "eol-last": 0,
  57. "import/newline-after-import": 0,
  58. "vue/multi-word-component-names": 0,
  59. "no-param-reassign": 0,
  60. "no-restricted-syntax": 0,
  61. "no-underscore-dangle": 0,
  62. "no-plusplus": 0,
  63. "no-bitwise": 0,
  64. "guard-for-in": 0,
  65. "func-names": 0,
  66. "import/order": 0,
  67. "vue/no-deprecated-slot-attribute": 0,
  68. "vue/v-on-event-hyphenation": 0,
  69. "vue/no-deprecated-filter": 0,
  70. "vue/require-explicit-emits": 0,
  71. "vue/no-v-html": 0,
  72. "vue/order-in-components": 0,
  73. "vue/no-reserved-component-names": 0,
  74. "no-promise-executor-return": 0,
  75. "no-sparse-arrays": 0,
  76. "no-nested-ternary": 0,
  77. "no-continue": 0,
  78. "complexity": 0,
  79. "no-return-await": 0,
  80. "max-classes-per-file": 0,
  81. "consistent-return": 0,
  82. "no-shadow": 0,
  83. "no-undef": 0,
  84. "no-throw-literal": 0,
  85. "no-loss-of-precision": 0,
  86. "no-prototype-builtins": 0,
  87. "no-fallthrough": 0,
  88. "no-case-declarations": 0,
  89. "no-cond-assign": 0,
  90. "prefer-destructuring": 1,
  91. "no-await-in-loop": 0
  92. }
  93. }