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.
eslint-restricted-globals
Advanced tools
A list of confusing globals that should be restricted to be used as globals
A list of confusing globals that should be restricted to be used as globals
$ npm install --save eslint-restricted-globals
Some global variables in browser are likely to be used by people without the intent of using them as globals, such as status
, name
etc.
And because eslint thinks of them as valid global variables, it does not warn in case of bugs.
For eg:
function foo(nama) {
if (nama) {
console.log(name)
}
}
Here we try to log variable nama
if it is truthy, but by mistake we are logging name
and as name
is a valid global, no eslint warning is shown.
To avoid this, we blacklist such confusing globals which are exported from this package. It contains the list of variables that we think should not be used without window.
qualifier. But as this is just a javascript array you can add, remove variables or even make your own list of variables.
Add this in your eslint config in rules property:
var restrictedGlobals = require('eslint-restricted-globals')
module.exports = {
rules: {
'no-restricted-globals': ['error'].concat(restrictedGlobals),
}
}
MIT
FAQs
A list of confusing globals that should be restricted to be used as globals
The npm package eslint-restricted-globals receives a total of 189,546 weekly downloads. As such, eslint-restricted-globals popularity was classified as popular.
We found that eslint-restricted-globals demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.