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

10
web/eslint-rules/utils.js Normal file
View File

@ -0,0 +1,10 @@
export const cleanJsonText = (text) => {
const cleaned = text.replaceAll(/,\s*\}/g, '}')
try {
JSON.parse(cleaned)
return cleaned
}
catch {
return text
}
}