Advertisement
Guest User

.eslintrc.js

a guest
Jul 20th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.03 KB | None | 0 0
  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. jest: true,
  11. es6: true
  12. },
  13. extends: [
  14. // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
  15. // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
  16. 'plugin:vue/essential',
  17. // https://github.com/standard/standard/blob/master/docs/RULES-en.md
  18. 'standard',
  19. 'eslint:recommended'
  20. ],
  21. // required to lint *.vue files
  22. plugins: [
  23. 'vue',
  24. 'html'
  25. ],
  26. // check if imports actually resolve
  27. settings: {
  28. 'import/resolver': {
  29. webpack: {
  30. config: 'build/webpack.base.conf.js'
  31. }
  32. }
  33. },
  34. // add your custom rules here
  35. // it is base on https://github.com/vuejs/eslint-config-vue
  36. rules: {
  37. 'accessor-pairs': 2,
  38. 'arrow-spacing': [
  39. 2,
  40. {
  41. before: true,
  42. after: true
  43. }
  44. ],
  45. 'block-spacing': [2, 'always'],
  46. 'brace-style': [
  47. 2,
  48. '1tbs',
  49. {
  50. allowSingleLine: true
  51. }
  52. ],
  53. camelcase: [
  54. 0,
  55. {
  56. properties: 'always'
  57. }
  58. ],
  59. 'comma-dangle': [2, 'never'],
  60. 'comma-spacing': [
  61. 2,
  62. {
  63. before: false,
  64. after: true
  65. }
  66. ],
  67. 'comma-style': [2, 'last'],
  68. 'constructor-super': 2,
  69. curly: [2, 'multi-line'],
  70. 'dot-location': [2, 'property'],
  71. 'eol-last': 2,
  72. eqeqeq: [2, 'allow-null'],
  73. 'generator-star-spacing': [
  74. 2,
  75. {
  76. before: true,
  77. after: true
  78. }
  79. ],
  80. 'handle-callback-err': [2, '^(err|error)$'],
  81. 'jsx-quotes': [2, 'prefer-single'],
  82. 'key-spacing': [
  83. 2,
  84. {
  85. beforeColon: false,
  86. afterColon: true
  87. }
  88. ],
  89. 'keyword-spacing': [
  90. 2,
  91. {
  92. before: true,
  93. after: true
  94. }
  95. ],
  96. 'new-cap': [
  97. 2,
  98. {
  99. newIsCap: true,
  100. capIsNew: false
  101. }
  102. ],
  103. 'new-parens': 2,
  104. 'no-array-constructor': 2,
  105. 'no-caller': 2,
  106. 'no-console': 'off',
  107. 'no-class-assign': 2,
  108. 'no-cond-assign': 2,
  109. 'no-const-assign': 2,
  110. 'no-control-regex': 0,
  111. 'no-delete-var': 2,
  112. 'no-dupe-args': 2,
  113. 'no-dupe-class-members': 2,
  114. 'no-dupe-keys': 2,
  115. 'no-duplicate-case': 2,
  116. 'no-empty-character-class': 2,
  117. 'no-empty-pattern': 2,
  118. 'no-eval': 2,
  119. 'no-ex-assign': 2,
  120. 'no-extend-native': 2,
  121. 'no-extra-bind': 2,
  122. 'no-extra-boolean-cast': 2,
  123. 'no-extra-parens': [2, 'functions'],
  124. 'no-fallthrough': 2,
  125. 'no-floating-decimal': 2,
  126. 'no-func-assign': 2,
  127. 'no-implied-eval': 2,
  128. 'no-inner-declarations': [2, 'functions'],
  129. 'no-invalid-regexp': 2,
  130. 'no-irregular-whitespace': 2,
  131. 'no-iterator': 2,
  132. 'no-label-var': 2,
  133. 'no-labels': [
  134. 2,
  135. {
  136. allowLoop: false,
  137. allowSwitch: false
  138. }
  139. ],
  140. 'no-lone-blocks': 2,
  141. 'no-mixed-spaces-and-tabs': 2,
  142. 'no-multi-spaces': 2,
  143. 'no-multi-str': 2,
  144. 'no-multiple-empty-lines': [
  145. 2,
  146. {
  147. max: 1
  148. }
  149. ],
  150. 'no-native-reassign': 2,
  151. 'no-negated-in-lhs': 2,
  152. 'no-new-object': 2,
  153. 'no-new-require': 2,
  154. 'no-new-symbol': 2,
  155. 'no-new-wrappers': 2,
  156. 'no-obj-calls': 2,
  157. 'no-octal': 2,
  158. 'no-octal-escape': 2,
  159. 'no-path-concat': 2,
  160. 'no-proto': 2,
  161. 'no-redeclare': 2,
  162. 'no-regex-spaces': 2,
  163. 'no-return-assign': [2, 'except-parens'],
  164. 'no-self-assign': 2,
  165. 'no-self-compare': 2,
  166. 'no-sequences': 2,
  167. 'no-shadow-restricted-names': 2,
  168. 'no-spaced-func': 2,
  169. 'no-sparse-arrays': 2,
  170. 'no-this-before-super': 2,
  171. 'no-throw-literal': 2,
  172. 'no-trailing-spaces': 2,
  173. 'no-undef': 2,
  174. 'no-undef-init': 2,
  175. 'no-unexpected-multiline': 2,
  176. 'no-unmodified-loop-condition': 2,
  177. 'no-unneeded-ternary': [
  178. 2,
  179. {
  180. defaultAssignment: false
  181. }
  182. ],
  183. 'no-unreachable': 2,
  184. 'no-unsafe-finally': 2,
  185. 'no-unused-vars': [
  186. 2,
  187. {
  188. vars: 'all',
  189. args: 'none'
  190. }
  191. ],
  192. 'no-useless-call': 2,
  193. 'no-useless-computed-key': 2,
  194. 'no-useless-constructor': 2,
  195. 'no-useless-escape': 0,
  196. 'no-whitespace-before-property': 2,
  197. 'no-with': 2,
  198. 'one-var': [
  199. 2,
  200. {
  201. initialized: 'never'
  202. }
  203. ],
  204. 'operator-linebreak': [
  205. 2,
  206. 'after',
  207. {
  208. overrides: {
  209. '?': 'before',
  210. ':': 'before'
  211. }
  212. }
  213. ],
  214. 'padded-blocks': [2, 'never'],
  215. quotes: [
  216. 2,
  217. 'single',
  218. {
  219. avoidEscape: true,
  220. allowTemplateLiterals: true
  221. }
  222. ],
  223. semi: [2, 'never'],
  224. 'semi-spacing': [
  225. 2,
  226. {
  227. before: false,
  228. after: true
  229. }
  230. ],
  231. 'space-before-blocks': [2, 'always'],
  232. 'space-before-function-paren': 'off',
  233. 'space-in-parens': [2, 'never'],
  234. 'space-infix-ops': 2,
  235. 'space-unary-ops': [
  236. 2,
  237. {
  238. words: true,
  239. nonwords: false
  240. }
  241. ],
  242. 'spaced-comment': [
  243. 2,
  244. 'always',
  245. {
  246. markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
  247. }
  248. ],
  249. 'template-curly-spacing': [2, 'never'],
  250. 'use-isnan': 2,
  251. 'valid-typeof': 2,
  252. 'wrap-iife': [2, 'any'],
  253. 'yield-star-spacing': [2, 'both'],
  254. yoda: [2, 'never'],
  255. 'prefer-const': 2,
  256. 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
  257. 'object-curly-spacing': [
  258. 2,
  259. 'always',
  260. {
  261. objectsInObjects: false
  262. }
  263. ],
  264. 'array-bracket-spacing': [2, 'never']
  265. }
  266. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement