ESLint rule that helps verify that i18n translation key starts with matching component name
pnpm add -D eslint eslint-plugin-eslint-plugin-i18n-prefixAdd to .eslintrc
{
"extends": ["plugin:eslint-plugin-i18n-prefix/recommended"]
}✅ Set in the recommended configuration
🔧 Automatically fixable by the --fix CLI option.
| Name | Description | 💼 | 🔧 |
|---|---|---|---|
| i18n-prefix | Ensure i18n translation key starts with matching component name. | ✅ | 🔧 |
Ensure i18n translation key starts with matching component name
{
"i18n-prefix/i18n-prefix": [
"error",
{
"translationFunctionName": "t",
"delimiter": ".",
"ignorePrefixes": []
}
]
}This can be used together with https://github.com/natura-cosmeticos/eslint-plugin-i18n-checker
