Registry / testing / eslint-plugin-lingui

eslint-plugin-lingui

JSON →
library0.13.1jsnpmunverified

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.

testing
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM-only since v0.13.0? Actually the package ships both CJS and ESM. CommonJS require is valid but default import is preferred for flat config.

import pluginLingui from 'eslint-plugin-lingui'

The flat config is under the 'flat/recommended' key. For legacy config, use 'plugin:lingui/recommended' in extends.

pluginLingui.configs['flat/recommended']

As of v0.13, rules that accept options use array syntax; simple rules use string severity. This is standard ESLint.

rules: { 'lingui/t-call-in-function': 'error' }

Flat ESLint config enabling recommended Lingui rules plus custom no-unlocalized-strings and text-restrictions rules.

// eslint.config.js import pluginLingui from 'eslint-plugin-lingui'; export default [ pluginLingui.configs['flat/recommended'], { plugins: { lingui: pluginLingui, }, rules: { 'lingui/no-unlocalized-strings': ['error', { ignoreNames: ['^_$'] }], 'lingui/text-restrictions': ['warn', { patterns: ['TODO'] }], }, }, ];
Debug
Known footguns
breakingFrom v0.12.0, TypeScript must be installed as a peer dependency for TypeScript-project support.
deprecatedThe legacy .eslintrc config format (extends: ['plugin:lingui/recommended']) is deprecated in favor of flat config (eslint.config.js).
gotchaThe 'no-unlocalized-strings' rule is not included in the recommended set by default; it must be explicitly configured.
gotchaUsing the plugin with ESLint < 8.37 is not supported and may cause errors.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
13 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
script
1
Resources