Registry / testing / react-i18next-lint

react-i18next-lint

JSON →
library1.3.1jsnpmunverified

A CLI tool for validating translation keys in react-i18next projects. v1.3.1 (latest). It scans React views and language JSON files to detect missing keys, zombie keys, empty translations, and misprint keys using regex matching. Offers configurable severity levels (disable/warning/error), deep search, and auto-fix for zombie keys. Differentiators: focused solely on react-i18next, supports URL-based language files, and includes misprint detection. Alternatives like i18next-scanner focus on extraction rather than validation. Released under semantic versioning with monthly updates.

npm install react-i18next-lint
INSTALL
IMPORT
SIG · REACT-I18NEXT-LINT
R
react-i18next-lint
testingjavascriptv1.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

react-i18next-lint CLI
npx react-i18next-lint -p ./src -l ./locales
react-i18next-lint -p ./src -l ./locales (without npx or global install)
The package is a CLI tool, not a library. Use npx or install globally. No programmatic API is exported.

Scans JSX/TSX files in src and JSON translation files in public/locales, reports missing keys as errors, zombie and empty keys as warnings.

npx react-i18next-lint -p "./src/**/*.{jsx,tsx}" -l "./public/locales/**/*.json" --kv error --zk warning --ek warning
react-i18next-lint --version
Debug
Known issues
gotchaThe --ds (deepSearch) option can significantly increase execution time on large projects.
fix
Use deep search only when necessary; consider narrowing the project glob pattern.
affects: >=1.0.0
gotchaThe --mk (misprintKeys) option may produce false positives with coefficient 0.9.
fix
Adjust --mc (misprintCoefficient) to a lower value (e.g., 0.8) to reduce false positives.
affects: >=1.0.0
breakingDefault severity for keysOnViews changed from 'warning' to 'error' in v1.1.0.
fix
Explicitly set --kv warning if you want the old behavior.
affects: >=1.1.0
deprecatedThe --fz (fixZombiesKeys) option is experimental and may be removed in future versions.
fix
Use with caution; backup language files before auto-fix.
affects: >=1.1.0
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, scandir './public/locales/en.json'
The language glob pattern does not match any existing files.
fix
Verify the path to language files; use --l './public/locales/**/*.json' to match nested files.
Error: Cannot find module 'glob'
Missing dependency when running via npx with an older npm version.
fix
Install glob globally or use a recent npm version (>=7) that auto-installs peer dependencies.
Warning: No translation keys found in views. Check your --project glob pattern.
The project glob pattern does not match any files with translation keys.
fix
Ensure the glob pattern includes file extensions like .jsx, .tsx, .js, .ts. Example: -p './src/**/*.{jsx,tsx}'
Upgrade
Version history
1.3.1latest on npm
Audit
Dependencies
globrequiredUsed for file pattern matching for project and language files
Agent activity
7 hits · last 30 days
node
6
Resources
react-i18next-lint — npm install react-i18next-lint · libregistry