Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
eslint-plugin-formatjs
Advanced tools
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.
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'
}
};
eslint-plugin-i18n is another ESLint plugin that provides rules for internationalization. It focuses on ensuring that i18n best practices are followed, such as checking for missing translations and enforcing consistent message formats. Compared to eslint-plugin-formatjs, it is more general and not specifically tied to FormatJS.
eslint-plugin-react-intl is an ESLint plugin specifically for React applications using the react-intl library. It provides rules to enforce best practices and consistency in the use of react-intl. While eslint-plugin-formatjs can be used with any JavaScript project, eslint-plugin-react-intl is tailored for React projects.
We've migrated the docs to https://formatjs.io/docs/tooling/linter.
FAQs
ESLint plugin for formatjs
The npm package eslint-plugin-formatjs receives a total of 101,487 weekly downloads. As such, eslint-plugin-formatjs popularity was classified as popular.
We found that eslint-plugin-formatjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.