🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-formatjs

Package Overview
Dependencies
Maintainers
3
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-formatjs

ESLint plugin for formatjs

5.4.0
latest
Source
npm
Version published
Weekly downloads
267K
-7.56%
Maintainers
3
Weekly downloads
 
Created

What is eslint-plugin-formatjs?

eslint-plugin-formatjs is an ESLint plugin that provides linting rules for the FormatJS library, which is used for internationalization (i18n) in JavaScript applications. The plugin helps ensure that your usage of FormatJS is consistent and follows best practices.

What are eslint-plugin-formatjs's main functionalities?

Enforce id attribute in messages

This rule ensures that all messages have an 'id' attribute, which is useful for consistency and maintainability in large projects.

module.exports = {
  'rules': {
    'formatjs/enforce-id': ['error', { 'idInterpolationPattern': '[sha512:contenthash:base64:6]' }]
  }
};

No multiple plurals

This rule prevents the use of multiple plural forms in a single message, which can lead to confusion and errors in translations.

module.exports = {
  'rules': {
    'formatjs/no-multiple-plurals': 'error'
  }
};

No id in define messages

This rule disallows the use of 'id' attributes in defineMessages, promoting the use of defaultMessage instead.

module.exports = {
  'rules': {
    'formatjs/no-id-in-define-messages': 'error'
  }
};

Other packages similar to eslint-plugin-formatjs

Keywords

eslint

FAQs

Package last updated on 15 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts