Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
eslint-plugin-i18n-text
Advanced tools
Disallow English text in string literals.
Embedding messages in JavaScript files prevents them from being translated into other languages. An alternative is to embed the translated text in the markup and find it with JavaScript.
<div class="js-message" data-success-message="It works!">…</div>
const el = document.querySelector('.js-message')
el.textContent = el.getAttribute('data-success-message')
This pattern allows the web framework that's generating the markup to use its translation library to insert the appropriate translated text.
You'll first need to install ESLint:
$ npm install eslint --save-dev
Next, install eslint-plugin-i18n-text
:
$ npm install eslint-plugin-i18n-text --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-i18n-text
globally.
Add i18n-text
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"i18n-text"
],
"rules": {
"i18n-text/no-en": 2
}
}
npm install
npm test
Distributed under the MIT license. See LICENSE for details.
FAQs
Disallow English text in string literals
The npm package eslint-plugin-i18n-text receives a total of 110,810 weekly downloads. As such, eslint-plugin-i18n-text popularity was classified as popular.
We found that eslint-plugin-i18n-text demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.