lingolint
v0.1.0
Published
ESLint for app translations. Catch missing keys, broken placeholders, HTML mismatches and untranslated strings before they reach production.
Maintainers
Readme
lingolint
Catch translation bugs before your users do. ESLint for app translations.
npx lingolint scan ./locales --source enCompares your locale JSON files and reports missing keys, obsolete keys, empty strings, placeholder mismatches ({amount}, {{amount}}, %s, …), unbalanced HTML tags, suspicious whitespace, untranslated strings, length outliers and duplicate translations. Exits 1 when errors are found, so the same command gates your CI.
Spanish (es) — 72/100
✖ ERROR checkout.total
Missing placeholder: {currency}
Source: "Total: {amount} {currency}"
Translation: "Total: {amount}"- Works offline. No account, server or API key.
- Nested JSON, ICU, i18next, printf and template placeholder styles.
--format jsonfor integrations,--fail-onfor CI thresholds.- Optional AI review with your own key (
--ai).
Full documentation, configuration reference and contribution guide: https://github.com/wpfsg/lingolint
Install
npm install -D lingolintNode.js 20.19+.
Configure
lingolint.config.ts:
import { defineConfig } from 'lingolint';
export default defineConfig({
sourceLocale: 'en',
localesPath: './locales',
failOn: 'error',
rules: {
length: ['warning', { maxRatio: 3 }],
identicalToSource: ['warning', { ignore: ['Notely'] }],
},
});CI
- run: npx lingolint scan ./locales --source en --fail-on errorMIT licensed.
