eslint.config.mjs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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/singleline-html-element-content-newline': [
  30. 'error',
  31. {
  32. externalIgnores: ['text'],
  33. },
  34. ],
  35. },
  36. formatters: {
  37. /**
  38. * Format CSS, LESS, SCSS files, also the `<style>` blocks in Vue
  39. * By default uses Prettier
  40. */
  41. css: true,
  42. /**
  43. * Format HTML files
  44. * By default uses Prettier
  45. */
  46. html: true,
  47. },
  48. })