Registry /
testing / eslint-plugin-react-i18n
ESLint plugin providing rules to enforce internationalization (i18n) in React applications, with primary support for i18next. Current stable version is 1.0.3 (released December 2019). The plugin includes rules such as 'no-dynamic-translation-keys' and 'no-missing-interpolation-keys' to catch common i18n mistakes. It is designed to be framework-agnostic but focuses on i18next, with openness to PRs for other frameworks. The package is maintained by lolatravel and has a low release cadence (no updates since 2019). Differentiator: focused solely on React i18n enforcement, unlike more general i18n linting tools.
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ESLint automatically strips 'eslint-plugin-' prefix from plugin names.
// In .eslintrc JSON:
{"plugins": ["react-i18n"]}
Rule names must include the plugin prefix without 'eslint-plugin-'.
// In .eslintrc rules:
{"react-i18n/no-dynamic-translation-keys": "error"}
This rule currently expects no options; configuration options may not be supported.
// In .eslintrc rules:
{"react-i18n/no-missing-interpolation-keys": "error"}
Setup ESLint with react-i18n plugin and recommended config, plus example of rule enforcement.
// Install ESLint and plugin:
// npm i -D eslint eslint-plugin-react-i18n
// .eslintrc.js
module.exports = {
plugins: ['react-i18n'],
extends: ['plugin:react-i18n/recommended'],
rules: {
'react-i18n/no-dynamic-translation-keys': 'error',
'react-i18n/no-missing-interpolation-keys': 'error',
},
};
// Example React component with i18next:
import { useTranslation } from 'react-i18next';
function MyComponent() {
const { t } = useTranslation();
// Bad: dynamic key
const key = 'greeting';
return <div>{t(key)}</div>; // no-dynamic-translation-keys warns
// Good: static string key
return <div>{t('greeting')}</div>;
}
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.