Registry / testing / eslint-plugin-format-message

eslint-plugin-format-message

JSON →
library6.2.4jsnpmunverified

ESLint plugin providing i18n-specific lint rules for format-message, an ICU Message Format internationalization library. Version 6.2.4 is the current stable release (last updated 2020). It includes 8 rules: literal-pattern, literal-locale, no-identical-translation, no-invalid-pattern, no-invalid-translation, no-missing-params, no-missing-translation, and translation-match-params. Requires eslint >=2.0.0. Key differentiator: integrates compile-time checks for format-message patterns, translations, and parameter usage, preventing runtime errors in i18n workflows.

npm install eslint-plugin-format-message
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-FORM
E
eslint-plugin-format-message
testingjavascriptv6.2.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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.

default
module.exports = { plugins: ['format-message'] }
import 'eslint-plugin-format-message'
ESLint plugins are configured via .eslintrc or eslint.config.js, not imported directly in code.
rules
const plugin = require('eslint-plugin-format-message'); const rules = plugin.rules;
import { rules } from 'eslint-plugin-format-message'
Plugin is CommonJS; ESM import not supported in ESLint plugin context.
configs
const plugin = require('eslint-plugin-format-message'); const recommended = plugin.configs.recommended;
import { configs } from 'eslint-plugin-format-message'
Configs exported as CommonJS; use require() to access them.

Configures ESLint with all format-message rules and settings for translation files.

// .eslintrc.json { "plugins": ["format-message"], "rules": { "format-message/literal-pattern": 1, "format-message/literal-locale": 1, "format-message/no-identical-translation": 1, "format-message/no-invalid-pattern": 2, "format-message/no-invalid-translation": 2, "format-message/no-missing-params": [2, { "allowNonLiteral": true }], "format-message/no-missing-translation": 1, "format-message/translation-match-params": 2 }, "settings": { "format-message": { "sourceLocale": "en", "translations": "./locales" } } }
Debug
Known issues
gotchaThe settings object must have 'translations' pointing to a directory containing JSON translation files; missing files cause silent rule failures.
fix
Ensure the 'translations' path exists and contains valid JSON translation files.
affects: >=6.0.0
breakingRule 'no-missing-params' changed default behavior: 'allowNonLiteral' defaults to true in v6, but was false in v5. Update config explicitly if you want the old strict behavior.
fix
Set 'allowNonLiteral' to false in the rule options to restore v5 strict checks.
affects: >=6.0.0
gotchaPlugins must be installed globally or locally; ESLint may not find them if not properly resolved with --resolve-plugins-relative-to flag.
fix
Install eslint-plugin-format-message in the project or use '--resolve-plugins-relative-to' with ESLint CLI.
affects: >=0.0.0
breakingSupport for ESLint <2.0.0 dropped in v6; plugin will not load with older ESLint versions.
fix
Upgrade ESLint to version 2.0.0 or later.
affects: >=6.0.0
gotchaTranslation matching rules expect a flat structure; nested keys in translations may not be recognized.
fix
Flatten the translation JSON files with separate keys for each message.
affects: >=6.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'format-message' declared in '...'
ESLint cannot find the plugin module; likely not installed or not in node_modules.
fix
Run 'npm install eslint-plugin-format-message --save-dev' and ensure the package is in your project's node_modules.
Definition for rule 'format-message/no-missing-params' was not found
Plugin not enabled in the ESLint configuration or misspelled rule name.
fix
Add '"plugins": ["format-message"]' to your ESLint config and verify rule names are correct.
Cannot find module 'format-message' from '...'
format-message (the main library) is not installed; plugin rules may reference it.
fix
Install format-message: 'npm install format-message' or ensure it's a peer dependency.
Expected a pattern but found '...'
Invalid ICU Message Format pattern used in a formatMessage call.
fix
Review the pattern syntax against ICU Message Format spec; fix curly braces and escaped characters.
Upgrade
Version history
6.2.4latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; plugin requires ESLint to function.
Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
eslint-plugin-format-message — npm install eslint-plugin-format-message · libregistry