{"id":19783,"library":"eslint-plugin-i18next","title":"eslint-plugin-i18next","description":"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.","status":"active","version":"6.1.4","language":"javascript","source_language":"en","source_url":"https://github.com/edvardchen/eslint-plugin-i18next","tags":["javascript","eslint","eslintplugin","eslint-plugin","i18n","i10next","internationalization","localization","typescript"],"install":[{"cmd":"npm install eslint-plugin-i18next","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-i18next","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-i18next","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Plugin is ESM-only since v6; require() fails with ERR_REQUIRE_ESM.","wrong":"const i18next = require('eslint-plugin-i18next');","symbol":"default (i18next)","correct":"import i18next from 'eslint-plugin-i18next';"},{"note":"Flat config is available only in v6+ with ESLint 9.","wrong":"require('eslint-plugin-i18next').configs['flat/recommended']","symbol":"configs['flat/recommended']","correct":"import i18next from 'eslint-plugin-i18next';\n// in eslint.config.mjs\ni18next.configs['flat/recommended']"},{"note":"Legacy config can still be used with ESLint 8; do not import in flat config.","wrong":"require('eslint-plugin-i18next').configs.recommended","symbol":"recommended (legacy)","correct":"// .eslintrc\n{\n  \"extends\": [\"plugin:i18next/recommended\"]\n}"},{"note":"Rules are accessed via the plugin prefix in ESLint config, not by direct import.","wrong":"import { rules } from 'eslint-plugin-i18next';\nrules['no-literal-string']","symbol":"rule: no-literal-string","correct":"// .eslintrc\n{\n  \"rules\": {\n    \"i18next/no-literal-string\": \"error\"\n  }\n}"}],"quickstart":{"code":"// eslint.config.mjs\nimport i18next from 'eslint-plugin-i18next';\n\nexport default [\n  {\n    files: ['**/*.{js,jsx,mjs,ts,tsx}'],\n    ...i18next.configs['flat/recommended'],\n  },\n  // override to only validate JSX text (v6 default)\n  {\n    rules: {\n      'i18next/no-literal-string': ['error', { mode: 'jsx-text-only' }]\n    }\n  }\n];","lang":"typescript","description":"Flat ESLint 9 configuration with default mode (JSX-only text) and recommended rules."},"warnings":[{"fix":"Explicitly set mode: 'all' in rule options to restore v5 behavior.","message":"v6 changed default no-literal-string mode from 'all' to 'jsx-text-only'. Existing projects may miss untranslated strings in non-JSX contexts.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Upgrade Node to >=18.10.0 or pin plugin to version 5.x.","message":"v6 drops support for Node versions below 18.10.0. Installments on older Node fail or break.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Use import syntax or migrate to dynamic import().","message":"v6 is ESM-only. Any require() call will throw ERR_REQUIRE_ESM.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Use flat config with i18next.configs['flat/recommended'] in eslint.config.mjs.","message":"Legacy .eslintrc config no longer works with ESLint 9 flat config. Mixing formats breaks.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Upgrade to v6 and migrate configuration accordingly.","message":"v5 and below are deprecated and will stop receiving updates. v6 rewrote the plugin.","severity":"deprecated","affected_versions":"<6.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install eslint-plugin-i18next --save-dev","cause":"Plugin not installed or not in node_modules.","error":"Error: Cannot find module 'eslint-plugin-i18next'"},{"fix":"Switch to ESM: change file extension to .mjs or use dynamic import: const i18next = await import('eslint-plugin-i18next');","cause":"Using require() on v6 ESM package in CommonJS context.","error":"TypeError: eslint-plugin-i18next is not a function or TypeError: i18next.configs is not iterable"},{"fix":"Add `plugins: { i18next }` or use the spread config: `...i18next.configs['flat/recommended']`","cause":"Plugin not listed in plugins array of flat config.","error":"ESLint couldn't find the plugin \"eslint-plugin-i18next\"."},{"fix":"Ensure the plugin is in plugins array and rule is spelled 'i18next/no-literal-string' (not 'i18n/no-literal-string').","cause":"Plugin not loaded correctly or rule name typo.","error":"Definition for rule 'i18next/no-literal-string' was not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}