跳到主要内容
版本:2.4.3

no-untranslated-text

确保 JSX 中的所有文本标签都被翻译 API 包裹。

When the i18n feature is used, this rule ensures that all labels appearing on the website are translatable, so no string accidentally slips through untranslated.

Rule Details

Examples of incorrect code for this rule:

// Hello World is not translated
<Component>Hello World</Component>

Examples of correct code for this rule:

// Hello World is translated
<Component>
<Translate>Hello World</Translate>
</Component>

Rule Configuration

接受的字段:

选项类型默认值描述
ignoredStringsstring[][]如果文本标签完全由此列表包含的字符串组成,将不会被报告。

When Not To Use It

If you're not using the i18n feature, you can disable this rule. 你也可以在不应被翻译的文本处禁用这条规则。

Further Reading