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.

testing
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 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>; }
Debug
Known footguns
deprecatedPlugin has not been updated since December 2019; may not support modern ESLint (>=7).
breakingESLint 7+ changed context.getScope() to context.sourceCode.getScope(); plugin may break.
gotchaRules only support i18next by default; other i18n libraries may not be recognized.
gotchaThe 'no-missing-interpolation-keys' rule may not detect all interpolation variants (e.g., nested objects).
gotchaPlugin requires ESLint as a peer dependency with versions ^3 || ^4 || ^5 || ^6; incompatibility with ESLint 8+.
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.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources