.eslintrc.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. module.exports = {
  2. root: true,
  3. // parser: 'vue-eslint-parser',
  4. // parserOptions: {
  5. // parser: '@typescript-eslint/parser',
  6. // ecmaVersion: 2020,
  7. // sourceType: 'module',
  8. // ecmaFeatures: {
  9. // jsx: true,
  10. // },
  11. // },
  12. env: {
  13. browser: true,
  14. node: true,
  15. es6: true
  16. },
  17. extends: [
  18. 'plugin:vue/vue3-recommended',
  19. '@vue/typescript/recommended',
  20. 'eslint:recommended'
  21. ],
  22. rules: {
  23. '@typescript-eslint/ban-ts-ignore': 'off',
  24. '@typescript-eslint/explicit-function-return-type': 'off',
  25. '@typescript-eslint/no-explicit-any': 'off',
  26. '@typescript-eslint/no-var-requires': 'off',
  27. '@typescript-eslint/no-empty-function': 'off',
  28. 'vue/custom-event-name-casing': 'off',
  29. 'no-use-before-define': 'off',
  30. '@typescript-eslint/no-use-before-define': 'off',
  31. '@typescript-eslint/ban-ts-comment': 'off',
  32. '@typescript-eslint/ban-types': 'off',
  33. '@typescript-eslint/no-non-null-assertion': 'off',
  34. '@typescript-eslint/explicit-module-boundary-types': 'off',
  35. 'vue/max-attributes-per-line': [
  36. 2,
  37. {
  38. singleline: 10,
  39. multiline: {
  40. max: 1,
  41. allowFirstLine: false
  42. }
  43. }
  44. ],
  45. 'vue/singleline-html-element-content-newline': 'off',
  46. 'vue/multiline-html-element-content-newline': 'off',
  47. 'vue/name-property-casing': [
  48. 'error',
  49. 'PascalCase'
  50. ],
  51. 'vue/no-v-html': 'off',
  52. 'accessor-pairs': 2,
  53. 'arrow-spacing': [
  54. 2,
  55. {
  56. before: true,
  57. after: true
  58. }
  59. ],
  60. 'block-spacing': [
  61. 2,
  62. 'always'
  63. ],
  64. 'brace-style': [
  65. 2,
  66. '1tbs',
  67. {
  68. allowSingleLine: true
  69. }
  70. ],
  71. camelcase: [
  72. 0,
  73. {
  74. properties: 'always'
  75. }
  76. ],
  77. 'comma-dangle': [
  78. 2,
  79. 'never'
  80. ],
  81. 'comma-spacing': [
  82. 2,
  83. {
  84. before: false,
  85. after: true
  86. }
  87. ],
  88. 'comma-style': [
  89. 2,
  90. 'last'
  91. ],
  92. 'constructor-super': 2,
  93. curly: [
  94. 2,
  95. 'multi-line'
  96. ],
  97. 'dot-location': [
  98. 2,
  99. 'property'
  100. ],
  101. 'eol-last': 2,
  102. eqeqeq: [
  103. 'error',
  104. 'always',
  105. {
  106. null: 'ignore'
  107. }
  108. ],
  109. 'generator-star-spacing': [
  110. 2,
  111. {
  112. before: true,
  113. after: true
  114. }
  115. ],
  116. 'handle-callback-err': [
  117. 2,
  118. '^(err|error)$'
  119. ],
  120. indent: [
  121. 2,
  122. 2
  123. ],
  124. 'jsx-quotes': [
  125. 2,
  126. 'prefer-single'
  127. ],
  128. 'key-spacing': [
  129. 2,
  130. {
  131. beforeColon: false,
  132. afterColon: true
  133. }
  134. ],
  135. 'keyword-spacing': [
  136. 2,
  137. {
  138. before: true,
  139. after: true
  140. }
  141. ],
  142. 'new-cap': [
  143. 2,
  144. {
  145. newIsCap: true,
  146. capIsNew: false
  147. }
  148. ],
  149. 'new-parens': 2,
  150. 'no-array-constructor': 2,
  151. 'no-caller': 2,
  152. 'no-console': 'off',
  153. 'no-class-assign': 2,
  154. 'no-cond-assign': 2,
  155. 'no-const-assign': 2,
  156. 'no-control-regex': 0,
  157. 'no-delete-var': 2,
  158. 'no-dupe-args': 2,
  159. 'no-dupe-class-members': 2,
  160. 'no-dupe-keys': 2,
  161. 'no-duplicate-case': 2,
  162. 'no-empty-character-class': 2,
  163. 'no-empty-pattern': 2,
  164. 'no-eval': 2,
  165. 'no-ex-assign': 2,
  166. 'no-extend-native': 2,
  167. 'no-extra-bind': 2,
  168. 'no-extra-boolean-cast': 2,
  169. 'no-extra-parens': [
  170. 2,
  171. 'functions'
  172. ],
  173. 'no-fallthrough': 2,
  174. 'no-floating-decimal': 2,
  175. 'no-func-assign': 2,
  176. 'no-implied-eval': 2,
  177. 'no-inner-declarations': [
  178. 2,
  179. 'functions'
  180. ],
  181. 'no-invalid-regexp': 2,
  182. 'no-irregular-whitespace': 2,
  183. 'no-iterator': 2,
  184. 'no-label-var': 2,
  185. 'no-labels': [
  186. 2,
  187. {
  188. allowLoop: false,
  189. allowSwitch: false
  190. }
  191. ],
  192. 'no-lone-blocks': 2,
  193. 'no-mixed-spaces-and-tabs': 2,
  194. 'no-multi-spaces': 2,
  195. 'no-multi-str': 2,
  196. 'no-multiple-empty-lines': [
  197. 2,
  198. {
  199. max: 1
  200. }
  201. ],
  202. 'no-native-reassign': 2,
  203. 'no-negated-in-lhs': 2,
  204. 'no-new-object': 2,
  205. 'no-new-require': 2,
  206. 'no-new-symbol': 2,
  207. 'no-new-wrappers': 2,
  208. 'no-obj-calls': 2,
  209. 'no-octal': 2,
  210. 'no-octal-escape': 2,
  211. 'no-path-concat': 2,
  212. 'no-proto': 2,
  213. 'no-redeclare': 2,
  214. 'no-regex-spaces': 2,
  215. 'no-return-assign': [
  216. 2,
  217. 'except-parens'
  218. ],
  219. 'no-self-assign': 2,
  220. 'no-self-compare': 2,
  221. 'no-sequences': 2,
  222. 'no-shadow-restricted-names': 2,
  223. 'no-spaced-func': 2,
  224. 'no-sparse-arrays': 2,
  225. 'no-this-before-super': 2,
  226. 'no-throw-literal': 2,
  227. 'no-trailing-spaces': 2,
  228. 'no-undef': 0,
  229. 'no-undef-init': 2,
  230. 'no-unexpected-multiline': 2,
  231. 'no-unmodified-loop-condition': 2,
  232. 'no-unneeded-ternary': [
  233. 2,
  234. {
  235. defaultAssignment: false
  236. }
  237. ],
  238. 'no-unreachable': 2,
  239. 'no-unsafe-finally': 2,
  240. 'no-unused-vars': [
  241. 1,
  242. {
  243. vars: 'all',
  244. args: 'none'
  245. }
  246. ],
  247. 'no-useless-call': 0,
  248. 'no-useless-computed-key': 2,
  249. 'no-useless-constructor': 2,
  250. 'no-useless-escape': 0,
  251. 'no-whitespace-before-property': 2,
  252. 'no-with': 2,
  253. 'one-var': [
  254. 2,
  255. {
  256. initialized: 'never'
  257. }
  258. ],
  259. 'operator-linebreak': [
  260. 2,
  261. 'after',
  262. {
  263. overrides: {
  264. '?': 'before',
  265. ':': 'before'
  266. }
  267. }
  268. ],
  269. 'padded-blocks': [
  270. 2,
  271. 'never'
  272. ],
  273. quotes: [
  274. 2,
  275. 'single',
  276. {
  277. avoidEscape: true,
  278. allowTemplateLiterals: true
  279. }
  280. ],
  281. semi: [
  282. 2,
  283. 'never'
  284. ],
  285. 'semi-spacing': [
  286. 2,
  287. {
  288. before: false,
  289. after: true
  290. }
  291. ],
  292. 'space-before-blocks': [
  293. 2,
  294. 'always'
  295. ],
  296. 'space-before-function-paren': [
  297. 2,
  298. 'never'
  299. ],
  300. 'space-in-parens': [
  301. 2,
  302. 'never'
  303. ],
  304. 'space-infix-ops': 2,
  305. 'space-unary-ops': [
  306. 2,
  307. {
  308. words: true,
  309. nonwords: false
  310. }
  311. ],
  312. 'spaced-comment': [
  313. 2,
  314. 'always',
  315. {
  316. markers: [
  317. 'global',
  318. 'globals',
  319. 'eslint',
  320. 'eslint-disable',
  321. '*package',
  322. '!',
  323. ','
  324. ]
  325. }
  326. ],
  327. 'template-curly-spacing': [
  328. 2,
  329. 'never'
  330. ],
  331. 'use-isnan': 2,
  332. 'valid-typeof': 2,
  333. 'wrap-iife': [
  334. 2,
  335. 'any'
  336. ],
  337. 'yield-star-spacing': [
  338. 2,
  339. 'both'
  340. ],
  341. yoda: [
  342. 2,
  343. 'never'
  344. ],
  345. 'prefer-const': 2,
  346. 'no-debugger': 0,
  347. 'object-curly-spacing': [
  348. 2,
  349. 'always',
  350. {
  351. objectsInObjects: false
  352. }
  353. ],
  354. 'array-bracket-spacing': [
  355. 2,
  356. 'never'
  357. ],
  358. 'vue/no-use-v-if-with-v-for': 'off',
  359. 'vue/no-v-model-argument': 'off'
  360. }
  361. }