Registry / testing / eslint-plugin-formatjs

eslint-plugin-formatjs

JSON →
library6.4.6jsnpmunverified

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.

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 v6; CommonJS require will fail.

import eslintPluginFormatjs from 'eslint-plugin-formatjs'

All rules are available as named exports for custom configurations.

import { rules } from 'eslint-plugin-formatjs'

Exposes 'recommended' and 'flat' configs for easy setup.

import { configs } from 'eslint-plugin-formatjs'

ESLint flat config setup with two FormatJS rules enabled.

import eslintPluginFormatjs from 'eslint-plugin-formatjs'; export default [ { plugins: { formatjs: eslintPluginFormatjs }, rules: { 'formatjs/enforce-description': 'error', 'formatjs/no-literal-string-in-jsx': 'warn' } } ];
Debug
Known footguns
breakingVersion 6 dropped support for ESLint 8; requires ESLint 9 or 10.
gotchaThe plugin is ESM-only since v6; using require() will throw an error.
deprecatedThe 'flat' config is now the default; the old .eslintrc format is deprecated for this plugin.
gotchaSome rules require @formatjs/ts-transformer to be installed when using TypeScript.
gotchaThe rule 'formatjs/no-literal-string-in-jsx' only works with react-intl; requires babel-plugin-formatjs or equivalent.
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
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources