eslint.config.mjs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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-useless-return': 'off',
  21. 'no-console': 'off',
  22. 'no-unused-vars': 'off',
  23. 'vue/no-unused-refs': 'off',
  24. 'unused-imports/no-unused-vars': 'off',
  25. 'eslint-comments/no-unlimited-disable': 'off',
  26. 'jsdoc/check-param-names': 'off',
  27. 'jsdoc/require-returns-description': 'off',
  28. 'ts/no-empty-object-type': 'off',
  29. 'no-extend-native': 'off',
  30. 'vue/singleline-html-element-content-newline': [
  31. 'error',
  32. {
  33. externalIgnores: ['text'],
  34. },
  35. ],
  36. },
  37. formatters: {
  38. /**
  39. * Format CSS, LESS, SCSS files, also the `<style>` blocks in Vue
  40. * By default uses Prettier
  41. */
  42. css: true,
  43. /**
  44. * Format HTML files
  45. * By default uses Prettier
  46. */
  47. html: true,
  48. },
  49. })