eslint-plugin-i18n-prefix
ESLint rule that helps verify that i18n translation key starts with matching component name
Installation
pnpm add -D eslint eslint-plugin-eslint-plugin-i18n-prefix
Usage
Add to .eslintrc
{
"extends": ["plugin:eslint-plugin-i18n-prefix/recommended"]
}
Rules
recommended
configuration
--fix
CLI option.
Name | Description | ||
---|---|---|---|
i18n-prefix | Ensure i18n translation key starts with matching component name. |
i18n-prefix
Ensure i18n translation key starts with matching component name
{
"i18n-prefix/i18n-prefix": [
"error",
{
"translationFunctionName": "t",
"delimiter": ".",
"ignorePrefixes": []
}
]
}
Notes
This can be used together with https://github.com/natura-cosmeticos/eslint-plugin-i18n-checker