.eslintrc.js 5.1 KB

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