An ESLint plugin (v0.25.0, actively maintained) that enforces proper usage of the Lingui internationalization library. It includes rules to detect untranslated strings, enforce `t` calls inside functions for dynamic language switching, prevent incorrect i18n macro usage, and validate message consistency against a reference JSON file. Key differentiators include support for JSX text, template literals, and customizable ignore patterns, making it suitable for large codebases migrating to Lingui v3+.
npm install eslint-plugin-string-to-linguiVerified import paths — ran on the pinned version, not inferred.
Configure all 8 ESLint rules to enforce Lingui best practices: detect untranslated strings, ensure t calls in functions, validate macros, and check messages against a reference file.
Use the exact rule name 'string-to-lingui/no-single-varibles-to-translate' in your configuration.
Use 'string-to-lingui/t-call-in-function' instead.
Add additional rules for any i18n methods you want to forbid.
Replace the array with an object: ["warn", { "sourcePath": "..." }]Ensure the rule configuration includes an object: ["error", { "ignore": ["rgba"] }]