You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

217 lines
5.3 KiB

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