eslint.config.mjs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import tseslint from '@electron-toolkit/eslint-config-ts'
  2. import eslintConfigPrettier from '@electron-toolkit/eslint-config-prettier'
  3. import eslintPluginVue from 'eslint-plugin-vue'
  4. import vueParser from 'vue-eslint-parser'
  5. export default tseslint.config(
  6. { ignores: ['**/node_modules', '**/dist', '**/out'] },
  7. tseslint.configs.recommended,
  8. eslintPluginVue.configs['flat/recommended'],
  9. {
  10. files: ['**/*.vue'],
  11. languageOptions: {
  12. parser: vueParser,
  13. parserOptions: {
  14. ecmaFeatures: {
  15. jsx: true
  16. },
  17. extraFileExtensions: ['.vue'],
  18. parser: tseslint.parser
  19. },
  20. globals: {
  21. PropType: 'readonly'
  22. }
  23. }
  24. },
  25. {
  26. files: ['**/*.{ts,mts,tsx,vue}'],
  27. rules: {
  28. '@typescript-eslint/explicit-function-return-type': 'off',
  29. '@typescript-eslint/explicit-module-boundary-types': 'off',
  30. '@typescript-eslint/no-empty-object-type': 'off',
  31. '@typescript-eslint/no-explicit-any': 'off',
  32. '@typescript-eslint/no-unsafe-function-type': 'off',
  33. 'vue/require-default-prop': 'off',
  34. 'vue/multi-word-component-names': 'off',
  35. 'vue/block-lang': [
  36. 'error',
  37. {
  38. script: {
  39. lang: 'ts'
  40. }
  41. }
  42. ],
  43. '@typescript-eslint/ban-ts-ignore': 'off',
  44. '@typescript-eslint/no-var-requires': 'off',
  45. '@typescript-eslint/no-empty-function': 'off',
  46. 'vue/custom-event-name-casing': 'off',
  47. 'no-use-before-define': 'off',
  48. '@typescript-eslint/no-use-before-define': 'off',
  49. '@typescript-eslint/ban-ts-comment': 'off',
  50. '@typescript-eslint/ban-types': 'off',
  51. '@typescript-eslint/no-non-null-assertion': 'off',
  52. 'space-before-function-paren': 'off',
  53. 'vue/attributes-order': 'off',
  54. 'vue/one-component-per-file': 'off',
  55. 'vue/html-closing-bracket-newline': 'off',
  56. 'vue/max-attributes-per-line': 'off',
  57. 'vue/multiline-html-element-content-newline': 'off',
  58. 'vue/singleline-html-element-content-newline': 'off',
  59. 'vue/attribute-hyphenation': 'off',
  60. 'vue/require-explicit-emits': 'off',
  61. 'vue/html-self-closing': [
  62. 'error',
  63. {
  64. html: {
  65. void: 'always',
  66. normal: 'never',
  67. component: 'always'
  68. },
  69. svg: 'always',
  70. math: 'always'
  71. }
  72. ]
  73. }
  74. },
  75. eslintConfigPrettier
  76. )