eslint.config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { defineConfig } from '@llius/eslint-config'
  2. export default defineConfig(
  3. {},
  4. {
  5. files: ['src/**/*.{js,vue}'],
  6. rules: {
  7. // 去除一行中的末尾多余空格
  8. 'no-trailing-spaces': [
  9. 'error',
  10. {
  11. skipBlankLines: true
  12. }
  13. ],
  14. // v-model:visible检测
  15. 'vue/no-v-model-argument': 'off',
  16. 'vue/no-v-for-template-key-on-child': 'off',
  17. 'vue/no-v-for-template-key': 'off',
  18. 'vue/no-use-v-if-with-v-for': 'off',
  19. 'vue/no-v-html': 'off',
  20. // fn () 去除函数调用后的空格
  21. 'func-call-spacing': ['error', 'never'],
  22. 'vue/v-on-event-hyphenation': 'off',
  23. // 非模板字符串不需要使用反引号
  24. quotes: [
  25. 'error',
  26. 'single',
  27. {
  28. avoidEscape: true,
  29. allowTemplateLiterals: false
  30. }
  31. ],
  32. 'prettier/prettier': [
  33. 'error',
  34. {
  35. printWidth: 80,
  36. tabWidth: 2,
  37. useTabs: false,
  38. semi: false,
  39. vueIndentScriptAndStyle: false,
  40. singleQuote: true,
  41. trailingComma: 'none',
  42. bracketSpacing: true,
  43. arrowParens: 'always',
  44. requirePragma: false,
  45. insertPragma: false,
  46. htmlWhitespaceSensitivity: 'ignore'
  47. },
  48. {
  49. usePrettierrc: false
  50. }
  51. ]
  52. }
  53. }
  54. )