@i18n-doctor/cli
v0.11.17
Published
Production CLI for i18n-doctor static localization analysis
Downloads
2,500
Maintainers
Readme
@i18n-doctor/cli
Static localization analysis for JavaScript and TypeScript projects.
Finds unused, missing, duplicate translation keys, and untranslated hardcoded UI text — without executing your code.
What's new in 0.11.17
- Windows scanner: keep distinct sources/locales when file indexes collide (no false hardlink drops)
What's new in 0.11.16
- Vite / Windows: resolve path aliases from
tsconfig.app.jsonandextends - Cross-file
schema(t)namespace flow works with Windows path separators and casing
What's new in 0.11.15
- Shared catalog modules: usage in any sibling namespace on the same source file clears unused for all (settings ↔ map spreads)
What's new in 0.11.14
- Route tab titles via
getRouteParam(..., "title")from*Routefiles (nestedsettings/childrenincluded) for…int(key)over API maps keyed by string enums (e.g.IPropertyType) without inventing missing keys- Spread-imported catalog keys underline the origin file, not the spreader
- Static catalog string concat (
"a" + "b") in JS/TS sources
What's new in 0.11.13
- Live unused-key updates: deleting one unused key keeps remaining underlines (no long rescan gap)
- Broader static usages: factory configs,
useMemomenus, remapped labels, prefixedFILTER_OPERATOR_*templates - Assigned-then-returned enum arrays; JSX helper prop indexing after helpers
What's new in 0.11.11
Inline i18next
resourcesmaps: same key inen/fais not a duplicateNested
translationobjects under locale maps are not double-extractedPath-alias imports (
app/*,@core/*) for translator factories and configsStore/object methods with
tparams; renamed Zustand selectorsMulti-namespace
addResourceBundleon one shared i18n moduleString-literal array maps, enum-typed
t(type as string),labelKey/ config lookupsi18n.t("KEY", { ns }), JSXObject.keys(Enum)→ childt(item), enum helper arraysbuildPayload({ t })namespace flow;t(data.actionType)/ nested enum property access
Install & run
# Run without installing
npx i18n-doctor check
# Install globally
npm install -g @i18n-doctor/cli
i18n-doctor checkUsage
i18n-doctor check [path] [options]
Options:
--dir <path> Analyze only files under this directory (relative to project root)
--json JSON report
--sarif SARIF 2.1.0 report
--markdown Markdown report
--html HTML report
--silent Exit code only, no output
--verbose Show timings
--config Path to config file
--locale Restrict to one locale
--namespace Restrict to one namespace
--base-locale Base locale for cross-locale coverage
--no-coverage Skip locale consistency analysisCheck one folder
Pass a subdirectory as [path], or use --dir from the project root:
# Only report issues in src/features/auth (still loads locale catalogs project-wide)
i18n-doctor check src/features/auth
i18n-doctor check --dir src/features/authMissing-key and untranslated findings are limited to code under that folder. Locale files outside the folder are still read so missing-key checks stay accurate. Unused-key and duplicate-key findings only appear when the catalog file is inside the scoped directory.
Rules
Configure in i18n-doctor.config.json:
| Rule | Default | Meaning |
| --- | --- | --- |
| unused-key | warning | Locale key never referenced in code |
| missing-key | error | Code uses a key missing from locale files |
| duplicate-key | warning | Key defined more than once |
| untranslated-text | info | Hardcoded UI text not passed through t() / similar |
Example:
{
"rules": {
"untranslated-text": "warning",
"unused-key": "error"
}
}Exit codes
| Code | Meaning | |---:|---| | 0 | No failing issues | | 1 | Issues found that fail the exit policy | | 2 | Config, I/O, or permission error |
Contributing
This is a beta release. Bug reports, feature requests, and pull requests are very welcome.
See the GitHub repo to get started.
License
MIT
