i18n-lint (v1.1.0) is a CLI and library tool for detecting hardcoded (untranslated) strings in HTML and template source files. It checks text nodes and attributes (default: alt, placeholder, title) against a list of built-in internationalization functions like `gettext()` and `i18n()`. Supports custom template delimiters (e.g., {{ }}, <%%>) for Mustache/Handlebars/EJS. Compiled with JSHint-compatible reporters and built-in default/unix/json output. Designed for Node.js >=0.8.0, with global install providing the `i18n-lint` binary. Key differentiator: it integrates linting into existing build pipelines via CLI or Node API, unlike gettext extraction tools.
npm install i18n-lintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage: lint an HTML string for hardcoded text, logging results.
Use -t "{{,}}" for CLI or templateDelimiters: ['{{', '}}'] for API.Use --attributes "aria-label,custom-attr" to include more.
Configure custom translation function names via options or .i18n-lintrc config file.
Use --help for usage. Ensure input files exist.
Consider using programmatic API or CLI flags instead.
Update to latest version (1.1.0). If using custom reporter, ensure compatibility.
Run `npm install i18n-lint` or `npm install -g i18n-lint`.
Use `import i18nLint from 'i18n-lint'` if using ESM; otherwise if CJS, use `const i18nLint = require('i18n-lint').default`.Use absolute path or ensure file is relative to current working directory. E.g., `--reporter /path/to/reporter.js`.
Specify correct delimiters with -t option, e.g., -t "{{,}}" for Handlebars, -t "<%,%>" for EJS.