.eslintrc.js 5.0 KB

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