Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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
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 3 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.