.eslintrc.cjs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * @Author: wyd
  3. * @Date: 2024-02
  4. * @LastEditors: wyd
  5. * @LastEditTime: 2024-03
  6. * @Description:
  7. */
  8. /* eslint-env node */
  9. require('@rushstack/eslint-patch/modern-module-resolution')
  10. module.exports = {
  11. root: true,
  12. extends: ['plugin:vue/vue3-essential', 'eslint:recommended', '@vue/eslint-config-typescript', '@vue/eslint-config-prettier'],
  13. // 小程序全局变量
  14. globals: {
  15. uni: true,
  16. wx: true,
  17. WechatMiniprogram: true,
  18. getCurrentPages: true,
  19. UniApp: true,
  20. UniHelper: true,
  21. Page: true,
  22. AnyObject: true
  23. },
  24. parserOptions: {
  25. ecmaVersion: 'latest'
  26. },
  27. rules: {
  28. 'prettier/prettier': [
  29. 'warn',
  30. {
  31. singleQuote: true,
  32. semi: false,
  33. printWidth: 150,
  34. trailingComma: 'none',
  35. endOfLine: 'auto'
  36. }
  37. ],
  38. 'vue/multi-word-component-names': ['off'],
  39. 'vue/no-setup-props-destructure': ['off'],
  40. 'vue/no-deprecated-html-element-is': ['off'],
  41. '@typescript-eslint/no-unused-vars': ['off'],
  42. 'comma-dangle': ['error', 'never'],
  43. 'comma-spacing': [
  44. 2,
  45. {
  46. before: false,
  47. after: true
  48. }
  49. ],
  50. 'comma-style': [2, 'last']
  51. }
  52. }