.eslintrc.json 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. "no-console": 0, // 禁用打印
  19. "comma-dangle": [
  20. 2,
  21. "never"
  22. ], // 禁止使用拖尾逗号
  23. "no-extra-semi": 2, // 禁止不必要的分号
  24. "array-bracket-spacing": [
  25. 2,
  26. "always"
  27. ], // 指定数组的元素之间要以空格隔开
  28. "jsx-quotes": 0, // 强制使用单引号
  29. "max-len": 0, // 强制一行的最大长度
  30. "semi": [
  31. 2,
  32. "never"
  33. ], // 禁止使用分号
  34. "no-unused-vars": 0,
  35. "no-unneeded-ternary": 0, // 禁止不必要的嵌套 var isYes = answer === 1 ? true : false;
  36. "no-unreachable": 2, // 不能有无法执行的代码
  37. "no-unused-expressions": 1, // 禁止无用的表达式
  38. "linebreak-style": [
  39. 0,
  40. "error",
  41. "windows"
  42. ],
  43. "import/no-unresolved": 0,
  44. "import/extensions": 0,
  45. "vue/multi-word-component-names": 0,
  46. "no-param-reassign": 0,
  47. "no-plusplus": 0,
  48. "vue/v-on-event-hyphenation": 0,
  49. "no-promise-executor-return": 0,
  50. "no-shadow": 0,
  51. "prefer-destructuring": 0,
  52. "no-new": 0,
  53. "func-names": 0,
  54. "no-nested-ternary": 0,
  55. "import/no-extraneous-dependencies": 0,
  56. "max-classes-per-file": 0,
  57. "class-methods-use-this": 0,
  58. "no-return-await": 0,
  59. "no-throw-literal": 0,
  60. "no-undef": 1
  61. }
  62. }