ESLint plugin for FormatJS that enforces best practices for internationalized messages. Current stable version is 6.4.6, with regular releases tied to the FormatJS monorepo. It provides rules for validating ICU message syntax, enforcing message extraction patterns, preventing missing descriptions, and ensuring consistent translation keys. Differentiates from generic i18n ESLint plugins by deep integration with intl-messageformat and react-intl, supporting both flat and nested message structures, and offering auto-fix for many rules. Requires ESLint 9 or 10.
npm install eslint-plugin-formatjsVerified import paths — ran on the pinned version, not inferred.
ESLint flat config setup with two FormatJS rules enabled.
Upgrade ESLint to 9.x or 10.x, or use eslint-plugin-formatjs@5.x.
Use import syntax or dynamic import() in CommonJS projects.
Migrate to ESLint flat config using configs['flat'].
Install @formatjs/ts-transformer as a dev dependency for TypeScript projects.
Ensure your build pipeline includes babel-plugin-formatjs or @formatjs/unplugin.
npm install eslint-plugin-formatjs --save-dev
Change to import statement: import eslintPluginFormatjs from 'eslint-plugin-formatjs'
Check node_modules for duplicate installations and deduplicate with npm dedupe.
Set parserOptions: { sourceType: 'module' } in ESLint config.