
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
eslint-plugin-consistent-return-legacy
Advanced tools
The consistent-return rule from ESLint 1.x.
In ESLint 1.x (as in this plugin), the rule only verifies that all or none of the return statements return a value.
For example, this would be legal:
function() {
if (foo) return foo;
if (bar) return bar;
}
In ESLint 2+, it verifies that all or none of the code paths return a value.
So the first example would not be legal; you'd need to do this:
function() {
if (foo) return foo;
if (bar) return bar;
return baz;
}
In some code the new behavior may produce many false negatives, e.g. when returning false
in jQuery event handlers.
npm i --save-dev eslint-plugin-consistent-return-legacy
{
"plugins": [
"consistent-return-legacy"
],
"rules": {
"consistent-return-legacy/consistent-return": 2
}
}
FAQs
The consistent-return rule from ESLint 1.x.
We found that eslint-plugin-consistent-return-legacy 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.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.