.eslintrc.js 5.9 KB

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