Registry / testing / eslint-plugin-react-i18n

eslint-plugin-react-i18n

JSON →
library1.0.3jsnpmunverified

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.

npm install eslint-plugin-react-i18n
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-REAC
E
eslint-plugin-react-i18n
testingjavascriptv1.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

eslint-plugin-react-i18n
// In .eslintrc JSON: {"plugins": ["react-i18n"]}
{"plugins": ["eslint-plugin-react-i18n"]}
ESLint automatically strips 'eslint-plugin-' prefix from plugin names.
react-i18n/no-dynamic-translation-keys
// In .eslintrc rules: {"react-i18n/no-dynamic-translation-keys": "error"}
{"no-dynamic-translation-keys": "error"}
Rule names must include the plugin prefix without 'eslint-plugin-'.
react-i18n/no-missing-interpolation-keys
// In .eslintrc rules: {"react-i18n/no-missing-interpolation-keys": "error"}
{"react-i18n/no-missing-interpolation-keys": ["error", {...}]}
This rule currently expects no options; configuration options may not be supported.

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>; }
Debug
Known issues
deprecatedPlugin has not been updated since December 2019; may not support modern ESLint (>=7).
fix
Consider alternative plugins like eslint-plugin-i18next or custom rules for newer ESLint versions.
affects: >=1.0.3
breakingESLint 7+ changed context.getScope() to context.sourceCode.getScope(); plugin may break.
fix
If using ESLint 7+, test thoroughly; may need to update plugin or use older ESLint (6.x).
affects: >=1.0.0
gotchaRules only support i18next by default; other i18n libraries may not be recognized.
fix
Use plugin with i18next or contribute PR for other libraries.
affects: >=1.0.0
gotchaThe 'no-missing-interpolation-keys' rule may not detect all interpolation variants (e.g., nested objects).
fix
Manually verify interpolation keys if using complex translation files.
affects: >=1.0.0
gotchaPlugin requires ESLint as a peer dependency with versions ^3 || ^4 || ^5 || ^6; incompatibility with ESLint 8+.
fix
Use ESLint 6.x or lower, or find a maintained fork.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'react-i18n': Cannot find module 'eslint-plugin-react-i18n'
Plugin not installed or not in node_modules.
fix
Run npm install eslint-plugin-react-i18n --save-dev
Definition for rule 'react-i18n/no-dynamic-translation-keys' was not found
Rule name misspelled or plugin not configured in plugins section.
fix
Add 'plugins: ["react-i18n"]' to .eslintrc config.
ESLint configuration error: missing 'eslint' peer dependency
ESLint not installed as dev dependency.
fix
Run npm install eslint --save-dev
No ESLint configuration found
No .eslintrc file present.
fix
Create an .eslintrc file (JSON, YAML, JS) and configure the plugin.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required to run the plugin
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-react-i18n — npm install eslint-plugin-react-i18n · libregistry