.eslintrc.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <<<<<<< HEAD
  2. // ESlint 检查配置
  3. module.exports = {
  4. root: true,
  5. parserOptions: {
  6. parser: 'babel-eslint',
  7. sourceType: 'module'
  8. },
  9. env: {
  10. browser: true,
  11. node: true,
  12. es6: true,
  13. },
  14. extends: ['plugin:vue/recommended', 'eslint:recommended'],
  15. // add your custom rules here
  16. //it is base on https://github.com/vuejs/eslint-config-vue
  17. rules: {
  18. "vue/max-attributes-per-line": [2, {
  19. "singleline": 10,
  20. "multiline": {
  21. "max": 1,
  22. "allowFirstLine": false
  23. }
  24. }],
  25. "vue/singleline-html-element-content-newline": "off",
  26. "vue/multiline-html-element-content-newline":"off",
  27. "vue/name-property-casing": ["error", "PascalCase"],
  28. "vue/no-v-html": "off",
  29. 'accessor-pairs': 2,
  30. 'arrow-spacing': [2, {
  31. 'before': true,
  32. 'after': true
  33. }],
  34. 'block-spacing': [2, 'always'],
  35. 'brace-style': [2, '1tbs', {
  36. 'allowSingleLine': true
  37. }],
  38. 'camelcase': [0, {
  39. 'properties': 'always'
  40. }],
  41. 'comma-dangle': [2, 'never'],
  42. 'comma-spacing': [2, {
  43. 'before': false,
  44. 'after': true
  45. }],
  46. 'comma-style': [2, 'last'],
  47. 'constructor-super': 2,
  48. 'curly': [2, 'multi-line'],
  49. 'dot-location': [2, 'property'],
  50. 'eol-last': 2,
  51. 'eqeqeq': ["error", "always", {"null": "ignore"}],
  52. 'generator-star-spacing': [2, {
  53. 'before': true,
  54. 'after': true
  55. }],
  56. 'handle-callback-err': [2, '^(err|error)$'],
  57. 'indent': [2, 2, {
  58. 'SwitchCase': 1
  59. }],
  60. 'jsx-quotes': [2, 'prefer-single'],
  61. 'key-spacing': [2, {
  62. 'beforeColon': false,
  63. 'afterColon': true
  64. }],
  65. 'keyword-spacing': [2, {
  66. 'before': true,
  67. 'after': true
  68. }],
  69. 'new-cap': [2, {
  70. 'newIsCap': true,
  71. 'capIsNew': false
  72. }],
  73. 'new-parens': 2,
  74. 'no-array-constructor': 2,
  75. 'no-caller': 2,
  76. 'no-console': 'off',
  77. 'no-class-assign': 2,
  78. 'no-cond-assign': 2,
  79. 'no-const-assign': 2,
  80. 'no-control-regex': 0,
  81. 'no-delete-var': 2,
  82. 'no-dupe-args': 2,
  83. 'no-dupe-class-members': 2,
  84. 'no-dupe-keys': 2,
  85. 'no-duplicate-case': 2,
  86. 'no-empty-character-class': 2,
  87. 'no-empty-pattern': 2,
  88. 'no-eval': 2,
  89. 'no-ex-assign': 2,
  90. 'no-extend-native': 2,
  91. 'no-extra-bind': 2,
  92. 'no-extra-boolean-cast': 2,
  93. 'no-extra-parens': [2, 'functions'],
  94. 'no-fallthrough': 2,
  95. 'no-floating-decimal': 2,
  96. 'no-func-assign': 2,
  97. 'no-implied-eval': 2,
  98. 'no-inner-declarations': [2, 'functions'],
  99. 'no-invalid-regexp': 2,
  100. 'no-irregular-whitespace': 2,
  101. 'no-iterator': 2,
  102. 'no-label-var': 2,
  103. 'no-labels': [2, {
  104. 'allowLoop': false,
  105. 'allowSwitch': false
  106. }],
  107. 'no-lone-blocks': 2,
  108. 'no-mixed-spaces-and-tabs': 2,
  109. 'no-multi-spaces': 2,
  110. 'no-multi-str': 2,
  111. 'no-multiple-empty-lines': [2, {
  112. 'max': 1
  113. }],
  114. 'no-native-reassign': 2,
  115. 'no-negated-in-lhs': 2,
  116. 'no-new-object': 2,
  117. 'no-new-require': 2,
  118. 'no-new-symbol': 2,
  119. 'no-new-wrappers': 2,
  120. 'no-obj-calls': 2,
  121. 'no-octal': 2,
  122. 'no-octal-escape': 2,
  123. 'no-path-concat': 2,
  124. 'no-proto': 2,
  125. 'no-redeclare': 2,
  126. 'no-regex-spaces': 2,
  127. 'no-return-assign': [2, 'except-parens'],
  128. 'no-self-assign': 2,
  129. 'no-self-compare': 2,
  130. 'no-sequences': 2,
  131. 'no-shadow-restricted-names': 2,
  132. 'no-spaced-func': 2,
  133. 'no-sparse-arrays': 2,
  134. 'no-this-before-super': 2,
  135. 'no-throw-literal': 2,
  136. 'no-trailing-spaces': 2,
  137. 'no-undef': 2,
  138. 'no-undef-init': 2,
  139. 'no-unexpected-multiline': 2,
  140. 'no-unmodified-loop-condition': 2,
  141. 'no-unneeded-ternary': [2, {
  142. 'defaultAssignment': false
  143. }],
  144. 'no-unreachable': 2,
  145. 'no-unsafe-finally': 2,
  146. 'no-unused-vars': [2, {
  147. 'vars': 'all',
  148. 'args': 'none'
  149. }],
  150. 'no-useless-call': 2,
  151. 'no-useless-computed-key': 2,
  152. 'no-useless-constructor': 2,
  153. 'no-useless-escape': 0,
  154. 'no-whitespace-before-property': 2,
  155. 'no-with': 2,
  156. 'one-var': [2, {
  157. 'initialized': 'never'
  158. }],
  159. 'operator-linebreak': [2, 'after', {
  160. 'overrides': {
  161. '?': 'before',
  162. ':': 'before'
  163. }
  164. }],
  165. 'padded-blocks': [2, 'never'],
  166. 'quotes': [2, 'single', {
  167. 'avoidEscape': true,
  168. 'allowTemplateLiterals': true
  169. }],
  170. 'semi': [2, 'never'],
  171. 'semi-spacing': [2, {
  172. 'before': false,
  173. 'after': true
  174. }],
  175. 'space-before-blocks': [2, 'always'],
  176. 'space-before-function-paren': [2, 'never'],
  177. 'space-in-parens': [2, 'never'],
  178. 'space-infix-ops': 2,
  179. 'space-unary-ops': [2, {
  180. 'words': true,
  181. 'nonwords': false
  182. }],
  183. 'spaced-comment': [2, 'always', {
  184. 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
  185. }],
  186. 'template-curly-spacing': [2, 'never'],
  187. 'use-isnan': 2,
  188. 'valid-typeof': 2,
  189. 'wrap-iife': [2, 'any'],
  190. 'yield-star-spacing': [2, 'both'],
  191. 'yoda': [2, 'never'],
  192. 'prefer-const': 2,
  193. 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
  194. 'object-curly-spacing': [2, 'always', {
  195. objectsInObjects: false
  196. }],
  197. 'array-bracket-spacing': [2, 'never']
  198. }
  199. }
  200. =======
  201. // ESlint 检查配置
  202. module.exports = {
  203. root: true,
  204. parserOptions: {
  205. parser: 'babel-eslint',
  206. sourceType: 'module'
  207. },
  208. env: {
  209. browser: true,
  210. node: true,
  211. es6: true,
  212. },
  213. extends: ['plugin:vue/recommended', 'eslint:recommended'],
  214. // add your custom rules here
  215. //it is base on https://github.com/vuejs/eslint-config-vue
  216. rules: {
  217. "vue/max-attributes-per-line": [2, {
  218. "singleline": 10,
  219. "multiline": {
  220. "max": 1,
  221. "allowFirstLine": false
  222. }
  223. }],
  224. "vue/singleline-html-element-content-newline": "off",
  225. "vue/multiline-html-element-content-newline":"off",
  226. "vue/name-property-casing": ["error", "PascalCase"],
  227. "vue/no-v-html": "off",
  228. 'accessor-pairs': 2,
  229. 'arrow-spacing': [2, {
  230. 'before': true,
  231. 'after': true
  232. }],
  233. 'block-spacing': [2, 'always'],
  234. 'brace-style': [2, '1tbs', {
  235. 'allowSingleLine': true
  236. }],
  237. 'camelcase': [0, {
  238. 'properties': 'always'
  239. }],
  240. 'comma-dangle': [2, 'never'],
  241. 'comma-spacing': [2, {
  242. 'before': false,
  243. 'after': true
  244. }],
  245. 'comma-style': [2, 'last'],
  246. 'constructor-super': 2,
  247. 'curly': [2, 'multi-line'],
  248. 'dot-location': [2, 'property'],
  249. 'eol-last': 2,
  250. 'eqeqeq': ["error", "always", {"null": "ignore"}],
  251. 'generator-star-spacing': [2, {
  252. 'before': true,
  253. 'after': true
  254. }],
  255. 'handle-callback-err': [2, '^(err|error)$'],
  256. 'indent': [2, 2, {
  257. 'SwitchCase': 1
  258. }],
  259. 'jsx-quotes': [2, 'prefer-single'],
  260. 'key-spacing': [2, {
  261. 'beforeColon': false,
  262. 'afterColon': true
  263. }],
  264. 'keyword-spacing': [2, {
  265. 'before': true,
  266. 'after': true
  267. }],
  268. 'new-cap': [2, {
  269. 'newIsCap': true,
  270. 'capIsNew': false
  271. }],
  272. 'new-parens': 2,
  273. 'no-array-constructor': 2,
  274. 'no-caller': 2,
  275. 'no-console': 'off',
  276. 'no-class-assign': 2,
  277. 'no-cond-assign': 2,
  278. 'no-const-assign': 2,
  279. 'no-control-regex': 0,
  280. 'no-delete-var': 2,
  281. 'no-dupe-args': 2,
  282. 'no-dupe-class-members': 2,
  283. 'no-dupe-keys': 2,
  284. 'no-duplicate-case': 2,
  285. 'no-empty-character-class': 2,
  286. 'no-empty-pattern': 2,
  287. 'no-eval': 2,
  288. 'no-ex-assign': 2,
  289. 'no-extend-native': 2,
  290. 'no-extra-bind': 2,
  291. 'no-extra-boolean-cast': 2,
  292. 'no-extra-parens': [2, 'functions'],
  293. 'no-fallthrough': 2,
  294. 'no-floating-decimal': 2,
  295. 'no-func-assign': 2,
  296. 'no-implied-eval': 2,
  297. 'no-inner-declarations': [2, 'functions'],
  298. 'no-invalid-regexp': 2,
  299. 'no-irregular-whitespace': 2,
  300. 'no-iterator': 2,
  301. 'no-label-var': 2,
  302. 'no-labels': [2, {
  303. 'allowLoop': false,
  304. 'allowSwitch': false
  305. }],
  306. 'no-lone-blocks': 2,
  307. 'no-mixed-spaces-and-tabs': 2,
  308. 'no-multi-spaces': 2,
  309. 'no-multi-str': 2,
  310. 'no-multiple-empty-lines': [2, {
  311. 'max': 1
  312. }],
  313. 'no-native-reassign': 2,
  314. 'no-negated-in-lhs': 2,
  315. 'no-new-object': 2,
  316. 'no-new-require': 2,
  317. 'no-new-symbol': 2,
  318. 'no-new-wrappers': 2,
  319. 'no-obj-calls': 2,
  320. 'no-octal': 2,
  321. 'no-octal-escape': 2,
  322. 'no-path-concat': 2,
  323. 'no-proto': 2,
  324. 'no-redeclare': 2,
  325. 'no-regex-spaces': 2,
  326. 'no-return-assign': [2, 'except-parens'],
  327. 'no-self-assign': 2,
  328. 'no-self-compare': 2,
  329. 'no-sequences': 2,
  330. 'no-shadow-restricted-names': 2,
  331. 'no-spaced-func': 2,
  332. 'no-sparse-arrays': 2,
  333. 'no-this-before-super': 2,
  334. 'no-throw-literal': 2,
  335. 'no-trailing-spaces': 2,
  336. 'no-undef': 2,
  337. 'no-undef-init': 2,
  338. 'no-unexpected-multiline': 2,
  339. 'no-unmodified-loop-condition': 2,
  340. 'no-unneeded-ternary': [2, {
  341. 'defaultAssignment': false
  342. }],
  343. 'no-unreachable': 2,
  344. 'no-unsafe-finally': 2,
  345. 'no-unused-vars': [2, {
  346. 'vars': 'all',
  347. 'args': 'none'
  348. }],
  349. 'no-useless-call': 2,
  350. 'no-useless-computed-key': 2,
  351. 'no-useless-constructor': 2,
  352. 'no-useless-escape': 0,
  353. 'no-whitespace-before-property': 2,
  354. 'no-with': 2,
  355. 'one-var': [2, {
  356. 'initialized': 'never'
  357. }],
  358. 'operator-linebreak': [2, 'after', {
  359. 'overrides': {
  360. '?': 'before',
  361. ':': 'before'
  362. }
  363. }],
  364. 'padded-blocks': [2, 'never'],
  365. 'quotes': [2, 'single', {
  366. 'avoidEscape': true,
  367. 'allowTemplateLiterals': true
  368. }],
  369. 'semi': [2, 'never'],
  370. 'semi-spacing': [2, {
  371. 'before': false,
  372. 'after': true
  373. }],
  374. 'space-before-blocks': [2, 'always'],
  375. 'space-before-function-paren': [2, 'never'],
  376. 'space-in-parens': [2, 'never'],
  377. 'space-infix-ops': 2,
  378. 'space-unary-ops': [2, {
  379. 'words': true,
  380. 'nonwords': false
  381. }],
  382. 'spaced-comment': [2, 'always', {
  383. 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
  384. }],
  385. 'template-curly-spacing': [2, 'never'],
  386. 'use-isnan': 2,
  387. 'valid-typeof': 2,
  388. 'wrap-iife': [2, 'any'],
  389. 'yield-star-spacing': [2, 'both'],
  390. 'yoda': [2, 'never'],
  391. 'prefer-const': 2,
  392. 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
  393. 'object-curly-spacing': [2, 'always', {
  394. objectsInObjects: false
  395. }],
  396. 'array-bracket-spacing': [2, 'never']
  397. }
  398. }
  399. >>>>>>> ec6eeb00ce64eb587a455406167d302dc3e59216