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.

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.

Plugin is ESM-only since v6; require() fails with ERR_REQUIRE_ESM.

import i18next from 'eslint-plugin-i18next';

Flat config is available only in v6+ with ESLint 9.

import i18next from 'eslint-plugin-i18next'; // in eslint.config.mjs i18next.configs['flat/recommended']

Legacy config can still be used with ESLint 8; do not import in flat config.

// .eslintrc { "extends": ["plugin:i18next/recommended"] }

Rules are accessed via the plugin prefix in ESLint config, not by direct import.

// .eslintrc { "rules": { "i18next/no-literal-string": "error" } }

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 footguns
breakingv6 changed default no-literal-string mode from 'all' to 'jsx-text-only'. Existing projects may miss untranslated strings in non-JSX contexts.
breakingv6 drops support for Node versions below 18.10.0. Installments on older Node fail or break.
breakingv6 is ESM-only. Any require() call will throw ERR_REQUIRE_ESM.
breakingLegacy .eslintrc config no longer works with ESLint 9 flat config. Mixing formats breaks.
deprecatedv5 and below are deprecated and will stop receiving updates. v6 rewrote the plugin.
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
13 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
script
1
Resources