Registry / testing / ngx-translate-lint

ngx-translate-lint

JSON →
library1.26.5jsnpmunverified

CLI tool to validate ngx-translate translation keys in Angular applications. Version 1.26.5. Uses regex to scan templates and language files for missing keys, zombie keys, empty values, and misprints. Supports glob patterns, config files, and URL-based language files. Differentiated by deep-search and fuzzy matching features. Releases follow semantic versioning on a monthly/quarterly cadence.

npm install ngx-translate-lint
INSTALL
IMPORT
SIG · NGX-TRANSLATE-LINT
N
ngx-translate-lint
testingjavascriptv1.26.5
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.

NgxTranslateLint
import { NgxTranslateLint } from 'ngx-translate-lint'
Default export for programmatic usage. Works with CommonJS via require().
cli
import { cli } from 'ngx-translate-lint'
Function to invoke the CLI programmatically. Accepts same options as command line.
Configuration
import { Configuration } from 'ngx-translate-lint'
Type for configuration object used with programmatic API.

Shows both CLI usage and programmatic TypeScript API for linting ngx-translate keys.

// Install globally: npm install -g ngx-translate-lint // Run CLI with project and languages paths: // ngx-translate-lint --project ./src --languages ./src/assets/i18n --keysOnViews error --zombieKeys warning import { NgxTranslateLint } from 'ngx-translate-lint'; const linter = new NgxTranslateLint({ project: './src', languages: './src/assets/i18n', keysOnViews: 'error', zombieKeys: 'warning', emptyKeys: 'disable', misprintKeys: 'disable', deepSearch: 'enable' }); linter.lint().then(result => { console.log('Lint complete. Errors:', result.errors.length, 'Warnings:', result.warnings.length); });
ngx-translate-lint --version
Debug
Known issues
gotchaIf using Angular 17+, ensure ngx-translate-lint version is >=1.22.0 to avoid compatibility issues.
fix
Update to latest: npm install -g ngx-translate-lint@latest
affects: <1.22.0
gotchaWhen loading languages from URL, the tool does not cache responses. Repeated runs will fetch again.
fix
Consider local language files for CI performance, or implement a caching proxy.
affects: >=1.23.0
gotchaThe --misprintKeys option can be very slow on large projects because it compares each key with a coefficient.
fix
Only enable misprintKeys when needed, and consider increasing --misprintCoefficient to 0.95+ to reduce matches.
affects: all
gotchaThe --deepSearch option adds each translation key to a global regex and can be very slow.
fix
Use --deepSearch disable unless you have a strong reason to scan for keys in all files.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'ngx-translate-lint'
Package not installed globally or locally.
fix
Run `npm install -g ngx-translate-lint` for CLI, or `npm install ngx-translate-lint --save-dev` for programmatic use.
ngx-translate-lint: command not found
Global installation may not be on PATH.
fix
Ensure npm global bin directory is in PATH, or use npx: `npx ngx-translate-lint`
Error: The path to languages folder does not exist
Provided --languages path is incorrect or relative path does not resolve.
fix
Use absolute path or verify relative path from project root. Example: `--languages ./src/assets/i18n`
Upgrade
Version history
1.26.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
ngx-translate-lint — npm install ngx-translate-lint · libregistry