{"id":19762,"library":"eslint-plugin-format-message","title":"eslint-plugin-format-message","description":"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.","status":"maintenance","version":"6.2.4","language":"javascript","source_language":"en","source_url":"https://github.com/format-message/format-message","tags":["javascript","eslintplugin","eslint","i18n","intl","internationalization","localization","globalization","messageformat"],"install":[{"cmd":"npm install eslint-plugin-format-message","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-format-message","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-format-message","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin requires ESLint to function.","package":"eslint","optional":false}],"imports":[{"note":"ESLint plugins are configured via .eslintrc or eslint.config.js, not imported directly in code.","wrong":"import 'eslint-plugin-format-message'","symbol":"default","correct":"module.exports = { plugins: ['format-message'] }"},{"note":"Plugin is CommonJS; ESM import not supported in ESLint plugin context.","wrong":"import { rules } from 'eslint-plugin-format-message'","symbol":"rules","correct":"const plugin = require('eslint-plugin-format-message'); const rules = plugin.rules;"},{"note":"Configs exported as CommonJS; use require() to access them.","wrong":"import { configs } from 'eslint-plugin-format-message'","symbol":"configs","correct":"const plugin = require('eslint-plugin-format-message'); const recommended = plugin.configs.recommended;"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"plugins\": [\"format-message\"],\n  \"rules\": {\n    \"format-message/literal-pattern\": 1,\n    \"format-message/literal-locale\": 1,\n    \"format-message/no-identical-translation\": 1,\n    \"format-message/no-invalid-pattern\": 2,\n    \"format-message/no-invalid-translation\": 2,\n    \"format-message/no-missing-params\": [2, { \"allowNonLiteral\": true }],\n    \"format-message/no-missing-translation\": 1,\n    \"format-message/translation-match-params\": 2\n  },\n  \"settings\": {\n    \"format-message\": {\n      \"sourceLocale\": \"en\",\n      \"translations\": \"./locales\"\n    }\n  }\n}","lang":"javascript","description":"Configures ESLint with all format-message rules and settings for translation files."},"warnings":[{"fix":"Ensure the 'translations' path exists and contains valid JSON translation files.","message":"The settings object must have 'translations' pointing to a directory containing JSON translation files; missing files cause silent rule failures.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Set 'allowNonLiteral' to false in the rule options to restore v5 strict checks.","message":"Rule '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.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Install eslint-plugin-format-message in the project or use '--resolve-plugins-relative-to' with ESLint CLI.","message":"Plugins must be installed globally or locally; ESLint may not find them if not properly resolved with --resolve-plugins-relative-to flag.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade ESLint to version 2.0.0 or later.","message":"Support for ESLint <2.0.0 dropped in v6; plugin will not load with older ESLint versions.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Flatten the translation JSON files with separate keys for each message.","message":"Translation matching rules expect a flat structure; nested keys in translations may not be recognized.","severity":"gotcha","affected_versions":">=6.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install eslint-plugin-format-message --save-dev' and ensure the package is in your project's node_modules.","cause":"ESLint cannot find the plugin module; likely not installed or not in node_modules.","error":"Error: Failed to load plugin 'format-message' declared in '...'"},{"fix":"Add '\"plugins\": [\"format-message\"]' to your ESLint config and verify rule names are correct.","cause":"Plugin not enabled in the ESLint configuration or misspelled rule name.","error":"Definition for rule 'format-message/no-missing-params' was not found"},{"fix":"Install format-message: 'npm install format-message' or ensure it's a peer dependency.","cause":"format-message (the main library) is not installed; plugin rules may reference it.","error":"Cannot find module 'format-message' from '...'"},{"fix":"Review the pattern syntax against ICU Message Format spec; fix curly braces and escaped characters.","cause":"Invalid ICU Message Format pattern used in a formatMessage call.","error":"Expected a pattern but found '...'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}