eslint.config.mjs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import uniHelper from '@uni-helper/eslint-config'
  2. export default uniHelper({
  3. unocss: true,
  4. vue: true,
  5. markdown: false,
  6. ignores: [
  7. 'src/uni_modules/',
  8. 'dist',
  9. // unplugin-auto-import 生成的类型文件,每次提交都改变,所以加入这里吧,与 .gitignore 配合使用
  10. 'auto-import.d.ts',
  11. // vite-plugin-uni-pages 生成的类型文件,每次切换分支都一堆不同的,所以直接 .gitignore
  12. 'uni-pages.d.ts',
  13. // 插件生成的文件
  14. 'src/pages.json',
  15. 'src/manifest.json',
  16. // 忽略自动生成文件
  17. 'src/service/app/**',
  18. ],
  19. rules: {
  20. 'no-console': 'off',
  21. 'no-unused-vars': 'off',
  22. 'vue/no-unused-refs': 'off',
  23. 'unused-imports/no-unused-vars': 'off',
  24. 'eslint-comments/no-unlimited-disable': 'off',
  25. 'jsdoc/check-param-names': 'off',
  26. 'jsdoc/require-returns-description': 'off',
  27. 'ts/no-empty-object-type': 'off',
  28. 'no-extend-native': 'off',
  29. 'vue/no-v-text-v-html-on-component': 'off', // 允许在 uni-app 组件上使用 v-html
  30. },
  31. formatters: {
  32. /**
  33. * Format CSS, LESS, SCSS files, also the `<style>` blocks in Vue
  34. * By default uses Prettier
  35. */
  36. css: true,
  37. /**
  38. * Format HTML files
  39. * By default uses Prettier
  40. */
  41. html: true,
  42. },
  43. })