ESLint plugin for Lingui, the internationalization (i18n) framework for JavaScript/TypeScript. Current stable version 0.13.1, released July 2024, with a steady monthly release cadence. It enforces best practices and catches common mistakes in Lingui usage: ensuring translations are called inside functions, no expressions inside message templates, no nested <Trans> components, consistent plural format, and more. Provides both recommended and custom configurations for flat and legacy ESLint configs. Key differentiator: purpose-built for Lingui, with deep integration into its macro system and JSX patterns, unlike generic i18n linters.
npm install eslint-plugin-linguiVerified import paths — ran on the pinned version, not inferred.
Flat ESLint config enabling recommended Lingui rules plus custom no-unlocalized-strings and text-restrictions rules.
Run 'npm install --save-dev typescript' if you use TypeScript.
Migrate to flat config: import pluginLingui from 'eslint-plugin-lingui' and use pluginLingui.configs['flat/recommended'].
Add 'lingui/no-unlocalized-strings': 'error' to your rules.
Upgrade ESLint to ^8.37.0 || ^9 || ^10.
Install the plugin locally: npm install --save-dev eslint-plugin-lingui
Remove .eslintrc.* and use only eslint.config.js.
Use 'error' string or ['error', options].