Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@calm/eslint-plugin-react-intl
Advanced tools
This is a plugin to ensure that Intl translations are being made correctly with react-intl. Since they should be stored in an object for translation, this disables plain text between html tags.
The plugin is actively supported by the Calm engineering team, and contributions/concerns are welcome at https://github.com/calm/eslint-plugin-react-intl.
There are three options to enable, and we recommend enabling all of them to ensure proper translations in all languages.
The { noTrailingWhitespace: true } option is set by default and is not necessary to declare in the rules section.
This is recommended as some languages don't have spaces between words.
Additionally, the option ignoreLinks
is set to true by default. Depending on your
use case, you may want to disable this.
<a>
tags by default are not checked (this can be disabled)-
)<track label="subtitles" />
)<img alt="description" />
)<Checkbox value="checkedA" inputProps={{ 'aria-label': 'Checkbox A' }} />
)
{variable}
declarations must be declared in the values
attributenumber
defaultMessage
and id
attributes set
requireDefaultMessage : false
defaultMessage
and id
attributes cannot be emptyrequireDescription
can optionally be set to require that all translations contain the description attributeformatDefineMessages: true
option in order to also check the defineMessages declaration from react-intl
requireIdAsString: false
will allow for variables in the id field
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install @calm/eslint-plugin-react-intl
:
$ npm install @calm/eslint-plugin-react-intl --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install @calm/eslint-plugin-react-intl
globally.
Add @calm/react-intl
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"@calm/react-intl"
]
}
Then configure the rules you want to use under the rules section.
It's recommended that you explicitly set each option.
The rules (with their default settings) are listed below.
{
"rules": {
"@calm/react-intl/missing-formatted-message": [2,
{
"noTrailingWhitespace": true,
"ignoreLinks": true,
"enforceLabels": false,
"enforceImageAlts": false,
"enforceInputProps": false
}
],
"@calm/react-intl/missing-attribute": [2,
{
"noTrailingWhitespace": true,
"noSpreadOperator": true,
"requireDescription": false,
"formatDefineMessages": false,
"requireIdAsString": true,
"requireDefaultMessage": true,
}
],
"@calm/react-intl/missing-values": 2
}
}
FAQs
Linter for React-Intl integration
We found that @calm/eslint-plugin-react-intl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 36 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.