康巴易测肤/伤疤uniapp小程序类
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.eslintrc.js 6.5KB

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