小说后台管理系统
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

277 рядки
5.6 KiB

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