.eslintrc.js 5.7 KB

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