check command scans your codebase for translation key usage and reports unused keys in your source file and missing keys that are referenced but not defined.
Usage
Options
| Flag | Description |
|---|---|
--json | Output machine-readable JSON |
What it does
Scan codebase
Recursively scans your project for translation function calls:
t('namespace.key')— i18next/react-i18nextformatMessage({ id: 'namespace.key' })— react-intl
Examples
Check for unused/missing keys:Notes
What files are scanned?
What files are scanned?
The command scans
.ts, .tsx, .js, .jsx, .vue, .svelte, and .astro files.It skips directories like node_modules, .git, .next, dist, build, .turbo, .vercel, and coverage.How are keys detected?
How are keys detected?
The command uses regex patterns to find translation function calls:
- Pattern 1:
t('namespace.key')— matches i18next - Pattern 2:
formatMessage({ id: 'namespace.key' })— matches react-intl
auth.login) are counted to avoid false positives from other APIs like path.split('.') or .get('Authorization').What about dynamic keys?
What about dynamic keys?
Dynamic keys like
t(\errors.$`)` are not detected by this command.If you use dynamic key construction, you may see “unused” warnings for keys that are actually used dynamically.When should I run this?
When should I run this?
Run
check periodically to:- Find dead keys that can be removed
- Catch missing translations before runtime errors
- Keep your locale files clean and maintainable