Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

208 lignes
5.4 KiB

il y a 2 semaines
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. es2021: true,
  5. node: true
  6. },
  7. globals: {
  8. defineProps: 'readonly',
  9. defineEmits: 'readonly',
  10. defineExpose: 'readonly'
  11. },
  12. parser: 'vue-eslint-parser',
  13. extends: [
  14. 'eslint:recommended',
  15. //'plugin:vue/vue3-essential',
  16. // 'plugin:@typescript-eslint/recommended'
  17. ],
  18. parserOptions: {
  19. // ecmaVersion: 'latest',
  20. // // parser: '@typescript-eslint/parser',
  21. // // sourceType: 'module'
  22. // parser: '@babel/eslint-parser',
  23. sourceType: 'module'
  24. },
  25. // plugins: ['vue', '@typescript-eslint'],
  26. plugins: ['vue'],
  27. rules: {
  28. 'vue/multi-word-component-names': 'off',
  29. // '@typescript-eslint/no-empty-function': 'off', // 关闭空方法检查
  30. // '@typescript-eslint/no-explicit-any': 'off', // 关闭any类型的警告
  31. 'vue/no-v-model-argument': 'off',
  32. 'no-async-promise-executor': 1,
  33. 'vue/singleline-html-element-content-newline': 'off',
  34. 'vue/multiline-html-element-content-newline': 'off',
  35. // 'vue/name-property-casing': ['error', 'PascalCase'],
  36. 'vue/no-v-html': 'off',
  37. 'vue/html-indent': [1, 2],
  38. 'vue/require-default-prop': 'off',
  39. 'vue/no-parsing-error': 1,
  40. 'vue/attributes-order': 0,
  41. 'vue/require-prop-types': 0,
  42. 'accessor-pairs': 2,
  43. 'arrow-spacing': [2, {
  44. 'before': true,
  45. 'after': true
  46. }],
  47. 'block-spacing': [2, 'always'],
  48. 'brace-style': 0,
  49. 'camelcase': [0, {
  50. 'properties': 'always'
  51. }],
  52. 'comma-dangle': [2, 'never'],
  53. 'comma-spacing': [2, {
  54. 'before': false,
  55. 'after': true
  56. }],
  57. 'comma-style': [2, 'last'],
  58. 'constructor-super': 2,
  59. 'curly': [2, 'multi-line'],
  60. 'dot-location': [2, 'property'],
  61. 'eol-last': 2,
  62. 'generator-star-spacing': [2, {
  63. 'before': true,
  64. 'after': true
  65. }],
  66. 'handle-callback-err': 0,
  67. 'indent': [1, 2, {
  68. 'SwitchCase': 1
  69. }],
  70. 'jsx-quotes': [2, 'prefer-single'],
  71. 'key-spacing': [2, {
  72. 'beforeColon': false,
  73. 'afterColon': true
  74. }],
  75. 'keyword-spacing': [2, {
  76. 'before': true,
  77. 'after': true
  78. }],
  79. 'new-parens': 2,
  80. 'no-array-constructor': 2,
  81. 'no-caller': 2,
  82. 'no-console': 'off',
  83. 'no-class-assign': 2,
  84. 'no-cond-assign': 2,
  85. 'no-const-assign': 2,
  86. 'no-control-regex': 0,
  87. 'no-delete-var': 2,
  88. 'no-dupe-args': 2,
  89. 'no-dupe-class-members': 2,
  90. 'no-dupe-keys': 2,
  91. 'no-duplicate-case': 2,
  92. 'no-empty': [
  93. 2,
  94. { 'allowEmptyCatch': true }
  95. ],
  96. 'no-empty-character-class': 2,
  97. 'no-empty-pattern': 2,
  98. 'no-ex-assign': 2,
  99. 'no-extend-native': 2,
  100. 'no-extra-bind': 2,
  101. 'no-extra-boolean-cast': 2,
  102. 'no-extra-parens': [2, 'functions'],
  103. 'no-fallthrough': 2,
  104. 'no-floating-decimal': 2,
  105. 'no-func-assign': 2,
  106. 'no-implied-eval': 2,
  107. 'no-inner-declarations': [2, 'functions'],
  108. 'no-invalid-regexp': 2,
  109. 'no-irregular-whitespace': 2,
  110. 'no-iterator': 2,
  111. 'no-label-var': 2,
  112. 'no-labels': [2, {
  113. 'allowLoop': false,
  114. 'allowSwitch': false
  115. }],
  116. 'no-lone-blocks': 2,
  117. 'no-mixed-spaces-and-tabs': 2,
  118. 'no-multi-spaces': 2,
  119. 'no-multi-str': 2,
  120. 'no-multiple-empty-lines': [2, {
  121. 'max': 1
  122. }],
  123. 'no-native-reassign': 2,
  124. 'no-negated-in-lhs': 2,
  125. 'no-new-object': 2,
  126. 'no-new-require': 2,
  127. 'no-new-symbol': 2,
  128. 'no-new-wrappers': 2,
  129. 'no-obj-calls': 2,
  130. 'no-octal': 2,
  131. 'no-octal-escape': 2,
  132. 'no-path-concat': 2,
  133. 'no-proto': 2,
  134. 'no-redeclare': 2,
  135. 'no-regex-spaces': 2,
  136. 'no-return-assign': [2, 'except-parens'],
  137. 'no-self-assign': 2,
  138. 'no-self-compare': 2,
  139. 'no-sequences': 2,
  140. 'no-shadow-restricted-names': 2,
  141. 'no-spaced-func': 2,
  142. 'no-sparse-arrays': 2,
  143. 'no-this-before-super': 2,
  144. 'no-throw-literal': 2,
  145. 'no-trailing-spaces': 2,
  146. 'no-undef': 0,
  147. // 'no-undef-init': 2,
  148. 'no-unexpected-multiline': 2,
  149. 'no-unmodified-loop-condition': 2,
  150. 'no-unneeded-ternary': [2, {
  151. 'defaultAssignment': false
  152. }],
  153. 'no-unreachable': 0,
  154. 'no-unsafe-finally': 2,
  155. // 'no-unused-vars': [2, {
  156. // 'vars': 'all',
  157. // 'args': 'none'
  158. // }],
  159. 'no-unused-vars':0,
  160. 'no-useless-call': 2,
  161. 'no-useless-computed-key': 2,
  162. 'no-useless-constructor': 2,
  163. 'no-useless-escape': 0,
  164. 'no-whitespace-before-property': 2,
  165. 'no-with': 2,
  166. 'one-var': [2, {
  167. 'initialized': 'never'
  168. }],
  169. 'operator-linebreak': [2, 'after', {
  170. 'overrides': {
  171. '?': 'before',
  172. ':': 'before'
  173. }
  174. }],
  175. 'padded-blocks': [2, 'never'],
  176. 'quotes': [2, 'single', {
  177. 'avoidEscape': true,
  178. 'allowTemplateLiterals': true
  179. }],
  180. 'semi': [2, 'never'],//always never
  181. 'semi-spacing': [2, {
  182. 'before': false,
  183. 'after': true
  184. }],
  185. 'space-before-blocks': [2, 'always'],
  186. 'space-before-function-paren': [2, 'never'],
  187. 'space-in-parens': [2, 'never'],
  188. 'space-infix-ops': 2,
  189. 'space-unary-ops': [2, {
  190. 'words': true,
  191. 'nonwords': false
  192. }],
  193. 'spaced-comment': [2, 'always', {
  194. 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
  195. }],
  196. 'template-curly-spacing': [2, 'never'],
  197. 'use-isnan': 2,
  198. 'valid-typeof': 2,
  199. 'wrap-iife': [2, 'any'],
  200. 'yield-star-spacing': [2, 'both'],
  201. 'yoda': [2, 'never'],
  202. 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
  203. 'object-curly-spacing': [2, 'always', {
  204. objectsInObjects: false
  205. }],
  206. 'array-bracket-spacing': [2, 'never']
  207. }
  208. };