Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
eslint-plugin-react-intl-sammy
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
The npm package eslint-plugin-react-intl-sammy receives a total of 92 weekly downloads. As such, eslint-plugin-react-intl-sammy popularity was classified as not popular.
We found that eslint-plugin-react-intl-sammy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.