chore(web): add ESLint rules for i18n JSON validation (#30491)

This commit is contained in:
Stephen Zhou
2026-01-05 15:49:31 +08:00
committed by GitHub
parent 631f999f65
commit 52149c0d9b
5 changed files with 160 additions and 9 deletions

View File

@@ -130,15 +130,6 @@ export default antfu(
sonarjs: sonar,
},
},
// allow generated i18n files (like i18n/*/workflow.ts) to exceed max-lines
{
files: ['i18n/**'],
rules: {
'sonarjs/max-lines': 'off',
'max-lines': 'off',
'jsonc/sort-keys': 'error',
},
},
tailwind.configs['flat/recommended'],
{
settings: {
@@ -191,4 +182,19 @@ export default antfu(
'dify-i18n/require-ns-option': 'error',
},
},
// i18n JSON validation rules
{
files: ['i18n/**/*.json'],
plugins: {
'dify-i18n': difyI18n,
},
rules: {
'sonarjs/max-lines': 'off',
'max-lines': 'off',
'jsonc/sort-keys': 'error',
'dify-i18n/valid-i18n-keys': 'error',
'dify-i18n/no-extra-keys': 'error',
},
},
)