|
1 | 1 | import pluginJs from '@eslint/js'
|
| 2 | +import pluginI18n from '@intlify/eslint-plugin-vue-i18n' |
2 | 3 | import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
|
3 | 4 | import unusedImports from 'eslint-plugin-unused-imports'
|
4 | 5 | import pluginVue from 'eslint-plugin-vue'
|
@@ -45,15 +46,50 @@ export default [
|
45 | 46 | },
|
46 | 47 | {
|
47 | 48 | plugins: {
|
48 |
| - 'unused-imports': unusedImports |
| 49 | + 'unused-imports': unusedImports, |
| 50 | + '@intlify/vue-i18n': pluginI18n |
49 | 51 | },
|
50 | 52 | rules: {
|
51 | 53 | '@typescript-eslint/no-floating-promises': 'error',
|
52 | 54 | '@typescript-eslint/no-explicit-any': 'off',
|
53 | 55 | '@typescript-eslint/no-unused-vars': 'off',
|
54 | 56 | '@typescript-eslint/prefer-as-const': 'off',
|
55 | 57 | 'unused-imports/no-unused-imports': 'error',
|
56 |
| - 'vue/no-v-html': 'off' |
| 58 | + 'vue/no-v-html': 'off', |
| 59 | + // i18n rules |
| 60 | + '@intlify/vue-i18n/no-raw-text': [ |
| 61 | + 'error', |
| 62 | + { |
| 63 | + // Ignore strings that are: |
| 64 | + // 1. Less than 2 characters |
| 65 | + // 2. Only symbols/numbers/whitespace (no letters) |
| 66 | + // 3. Match specific patterns |
| 67 | + ignorePattern: |
| 68 | + '^[^a-zA-Z]*$|^.{0,1}$|^[\\w._%+-]+@[\\w.-]+\\.[A-Za-z]{2,}$', |
| 69 | + ignoreNodes: ['md-icon', 'v-icon', 'pre', 'code', 'script', 'style'], |
| 70 | + // Brand names and technical terms that shouldn't be translated |
| 71 | + ignoreText: [ |
| 72 | + 'ComfyUI', |
| 73 | + 'GitHub', |
| 74 | + 'OpenAI', |
| 75 | + 'API', |
| 76 | + 'URL', |
| 77 | + 'JSON', |
| 78 | + 'YAML', |
| 79 | + 'GPU', |
| 80 | + 'CPU', |
| 81 | + 'RAM', |
| 82 | + 'GB', |
| 83 | + 'MB', |
| 84 | + 'KB', |
| 85 | + 'ms', |
| 86 | + 'fps', |
| 87 | + 'px', |
| 88 | + 'App Data:', |
| 89 | + 'App Path:' |
| 90 | + ] |
| 91 | + } |
| 92 | + ] |
57 | 93 | }
|
58 | 94 | }
|
59 | 95 | ]
|
0 commit comments