Skip to content

no-unlocalized-jsx-attributes

Require translation for literal user-visible JSX attributes in opted-in localized interfaces.

Why

Accessible labels and placeholders must follow the interface language along with visible copy.

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
<input placeholder="Search" />;
After — preferred Resolve the message through translation
src/message.tsx
<input placeholder={t("search")} />;

Options

{
"additionalProperties": false,
"properties": {
"allowText": {
"items": { "type": "string" },
"type": "array",
"uniqueItems": true
},
"attributes": {
"items": { "minLength": 1, "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"
}