Registry / testing / eslint-plugin-i18next

eslint-plugin-i18next

JSON →
library6.1.4jsnpmunverified

ESLint plugin enforcing i18n best practices by flagging untranslated literal strings in JSX and JavaScript. Current stable version 6.1.4 is ESM-only, requires Node >=18.10, and ships TypeScript declarations. Breaking change in v6: default behavior only validates plain text in JSX markup (not all strings). Provides flat config support for ESLint 9 and legacy .eslintrc format for ESLint 8. Key differentiator: auto-fix is intentionally disabled because translation keys rarely match the literal string.

npm install eslint-plugin-i18next
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-I18N
E
eslint-plugin-i18next
testingjavascriptv6.1.4
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.

default (i18next)
import i18next from 'eslint-plugin-i18next';
const i18next = require('eslint-plugin-i18next');
Plugin is ESM-only since v6; require() fails with ERR_REQUIRE_ESM.
configs['flat/recommended']
import i18next from 'eslint-plugin-i18next'; // in eslint.config.mjs i18next.configs['flat/recommended']
require('eslint-plugin-i18next').configs['flat/recommended']
Flat config is available only in v6+ with ESLint 9.
recommended (legacy)
// .eslintrc { "extends": ["plugin:i18next/recommended"] }
require('eslint-plugin-i18next').configs.recommended
Legacy config can still be used with ESLint 8; do not import in flat config.
rule: no-literal-string
// .eslintrc { "rules": { "i18next/no-literal-string": "error" } }
import { rules } from 'eslint-plugin-i18next'; rules['no-literal-string']
Rules are accessed via the plugin prefix in ESLint config, not by direct import.

Flat ESLint 9 configuration with default mode (JSX-only text) and recommended rules.

// eslint.config.mjs import i18next from 'eslint-plugin-i18next'; export default [ { files: ['**/*.{js,jsx,mjs,ts,tsx}'], ...i18next.configs['flat/recommended'], }, // override to only validate JSX text (v6 default) { rules: { 'i18next/no-literal-string': ['error', { mode: 'jsx-text-only' }] } } ];
Debug
Known issues
breakingv6 changed default no-literal-string mode from 'all' to 'jsx-text-only'. Existing projects may miss untranslated strings in non-JSX contexts.
fix
Explicitly set mode: 'all' in rule options to restore v5 behavior.
affects: >=6.0.0
breakingv6 drops support for Node versions below 18.10.0. Installments on older Node fail or break.
fix
Upgrade Node to >=18.10.0 or pin plugin to version 5.x.
affects: >=6.0.0
breakingv6 is ESM-only. Any require() call will throw ERR_REQUIRE_ESM.
fix
Use import syntax or migrate to dynamic import().
affects: >=6.0.0
breakingLegacy .eslintrc config no longer works with ESLint 9 flat config. Mixing formats breaks.
fix
Use flat config with i18next.configs['flat/recommended'] in eslint.config.mjs.
affects: >=6.0.0
deprecatedv5 and below are deprecated and will stop receiving updates. v6 rewrote the plugin.
fix
Upgrade to v6 and migrate configuration accordingly.
affects: <6.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-plugin-i18next'
Plugin not installed or not in node_modules.
fix
npm install eslint-plugin-i18next --save-dev
TypeError: eslint-plugin-i18next is not a function or TypeError: i18next.configs is not iterable
Using require() on v6 ESM package in CommonJS context.
fix
Switch to ESM: change file extension to .mjs or use dynamic import: const i18next = await import('eslint-plugin-i18next');
ESLint couldn't find the plugin "eslint-plugin-i18next".
Plugin not listed in plugins array of flat config.
fix
Add `plugins: { i18next }` or use the spread config: `...i18next.configs['flat/recommended']`
Definition for rule 'i18next/no-literal-string' was not found
Plugin not loaded correctly or rule name typo.
fix
Ensure the plugin is in plugins array and rule is spelled 'i18next/no-literal-string' (not 'i18n/no-literal-string').
Upgrade
Version history
6.1.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
eslint-plugin-i18next — npm install eslint-plugin-i18next · libregistry