Skip to content

no-unlocalized-jsx-text

Require translation for literal JSX text in opted-in localized interfaces.

Why

Literal UI copy cannot change with the selected language.

Fix

Pass the user-facing message through the configured translation API, or explicitly exempt text that must remain literal.

Examples

Before — flagged Translate a user-facing message
src/message.tsx
<p>Hello</p>;
After — preferred Resolve the message through translation
src/message.tsx
<p>{t("hello")}</p>;

Options

{
"additionalProperties": false,
"properties": {
"allowText": {
"items": { "type": "string" },
"type": "array",
"uniqueItems": true
},
"enabled": { "type": "boolean" },
"translationComponents": {
"items": {
"additionalProperties": false,
"properties": {
"export": { "minLength": 1, "type": "string" },
"module": { "minLength": 1, "type": "string" }
},
"required": ["module", "export"],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}