.eslintrc.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. "indent": ["off", 0],
  17. "vue/max-attributes-per-line": [2, {
  18. "singleline": 10,
  19. "multiline": {
  20. "max": 1,
  21. "allowFirstLine": false
  22. }
  23. }],
  24. "vue/name-property-casing": ["error", "PascalCase"],
  25. 'accessor-pairs': 2,
  26. 'arrow-spacing': [2, {
  27. 'before': true,
  28. 'after': true
  29. }],
  30. 'block-spacing': [2, 'always'],
  31. 'brace-style': "off",
  32. 'camelcase': [0, {
  33. 'properties': 'always'
  34. }],
  35. 'comma-dangle': [2, 'never'],
  36. 'comma-spacing': [2, {
  37. 'before': false,
  38. 'after': true
  39. }],
  40. 'comma-style': [2, 'last'],
  41. 'constructor-super': 2,
  42. 'curly': [2, 'multi-line'],
  43. 'dot-location': [2, 'property'],
  44. 'eol-last': 2,
  45. 'eqeqeq': "off",
  46. 'generator-star-spacing': [2, {
  47. 'before': true,
  48. 'after': true
  49. }],
  50. 'handle-callback-err': [2, '^(err|error)$'],
  51. 'indent': [2, 2, {
  52. 'SwitchCase': 1
  53. }],
  54. 'jsx-quotes': [2, 'prefer-single'],
  55. 'key-spacing': [2, {
  56. 'beforeColon': false,
  57. 'afterColon': true
  58. }],
  59. 'keyword-spacing': [2, {
  60. 'before': true,
  61. 'after': true
  62. }],
  63. 'new-cap': "off",
  64. 'new-parens': 2,
  65. 'no-array-constructor': 2,
  66. 'no-caller': "off",
  67. 'no-console': 'off',
  68. 'no-class-assign': 2,
  69. 'no-cond-assign': "off",
  70. 'no-const-assign': 2,
  71. 'no-constant-condition': "off",
  72. 'no-control-regex': 0,
  73. 'no-delete-var': 2,
  74. 'no-dupe-args': 2,
  75. 'no-dupe-class-members': 2,
  76. 'no-dupe-keys': 2,
  77. 'no-duplicate-case': 2,
  78. 'no-empty': "off",
  79. 'no-empty-character-class': "off",
  80. 'no-empty-pattern': "off",
  81. 'no-eval': "off",
  82. 'no-ex-assign': 2,
  83. 'no-extend-native': 2,
  84. 'no-extra-bind': 2,
  85. 'no-extra-boolean-cast': 2,
  86. 'no-extra-parens': [2, 'functions'],
  87. 'no-fallthrough': "off",
  88. 'no-floating-decimal': 2,
  89. 'no-func-assign': "off",
  90. 'no-implied-eval': 2,
  91. 'no-inner-declarations': "off",
  92. 'no-invalid-regexp': 2,
  93. 'no-irregular-whitespace': 2,
  94. 'no-iterator': 2,
  95. 'no-label-var': 2,
  96. 'no-labels': [2, {
  97. 'allowLoop': false,
  98. 'allowSwitch': false
  99. }],
  100. 'no-lone-blocks': 2,
  101. 'no-mixed-spaces-and-tabs': 2,
  102. 'no-multi-spaces': 2,
  103. 'no-multi-str': 2,
  104. 'no-multiple-empty-lines': [2, {
  105. 'max': 1
  106. }],
  107. 'no-native-reassign': 2,
  108. 'no-negated-in-lhs': 2,
  109. 'no-new-object': 2,
  110. 'no-new-require': 2,
  111. 'no-new-symbol': 2,
  112. 'no-new-wrappers': 2,
  113. 'no-obj-calls': 2,
  114. 'no-octal': 2,
  115. 'no-octal-escape': 2,
  116. 'no-path-concat': 2,
  117. 'no-proto': 2,
  118. 'no-redeclare': "off",
  119. 'no-regex-spaces': 2,
  120. 'no-return-assign': "off",
  121. 'no-self-assign': 2,
  122. 'no-self-compare': 2,
  123. 'no-sequences': "off",
  124. 'no-shadow-restricted-names': 2,
  125. 'no-spaced-func': 2,
  126. 'no-sparse-arrays': 2,
  127. 'no-this-before-super': 2,
  128. 'no-throw-literal': "off",
  129. 'no-trailing-spaces': 2,
  130. 'no-undef': "off",
  131. 'no-undef-init': "off",
  132. 'no-unexpected-multiline': "off",
  133. 'no-unmodified-loop-condition': "off",
  134. 'no-unneeded-ternary': "off",
  135. 'no-unreachable': "off",
  136. 'no-unsafe-finally': 2,
  137. 'no-unused-vars': [2, {
  138. 'vars': 'all',
  139. 'args': 'none'
  140. }],
  141. 'no-useless-call': 2,
  142. 'no-useless-computed-key': 2,
  143. 'no-useless-constructor': 2,
  144. 'no-useless-escape': 0,
  145. 'no-whitespace-before-property': 2,
  146. 'no-with': 2,
  147. "no-tabs":"off",
  148. 'one-var': "off",
  149. 'operator-linebreak': [2, 'after', {
  150. 'overrides': {
  151. '?': 'before',
  152. ':': 'before'
  153. }
  154. }],
  155. 'padded-blocks': [2, 'never'],
  156. 'quotes': [2, 'single', {
  157. 'avoidEscape': true,
  158. 'allowTemplateLiterals': true
  159. }],
  160. 'semi': [2, 'never'],
  161. 'semi-spacing': [2, {
  162. 'before': false,
  163. 'after': true
  164. }],
  165. 'space-before-blocks': [2, 'always'],
  166. 'space-before-function-paren': 0,
  167. 'spaced-comment': [2, 'always', {
  168. 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
  169. }],
  170. 'template-curly-spacing': [2, 'never'],
  171. 'use-isnan': 2,
  172. 'valid-typeof': 2,
  173. 'wrap-iife': [2, 'any'],
  174. 'yield-star-spacing': [2, 'both'],
  175. 'yoda': [2, 'never'],
  176. 'prefer-const': 2,
  177. 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
  178. 'object-curly-spacing': [2, 'always', {
  179. objectsInObjects: false
  180. }],
  181. 'array-bracket-spacing': [2, 'never'],
  182. "no-unused-vars": "off",
  183. }
  184. }