Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-promise

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-promise - npm Package Compare versions

Comparing version 4.1.1 to 4.2.1

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 4.2.1
- Added more use cases to `no-return-wrap`
## 4.0.1

@@ -2,0 +6,0 @@

2

package.json
{
"name": "eslint-plugin-promise",
"version": "4.1.1",
"version": "4.2.1",
"description": "Enforce best practices for JavaScript promises",

@@ -5,0 +5,0 @@ "keywords": [

@@ -13,6 +13,25 @@ /**

function isInPromise(context) {
const expression = context
let functionNode = context
.getAncestors()
.filter(node => node.type === 'ExpressionStatement')[0]
return expression && expression.expression && isPromise(expression.expression)
.filter(node => {
return (
node.type === 'ArrowFunctionExpression' ||
node.type === 'FunctionExpression'
)
})
.reverse()[0]
while (
functionNode &&
functionNode.parent &&
functionNode.parent.type === 'MemberExpression' &&
functionNode.parent.object === functionNode &&
functionNode.parent.property.type === 'Identifier' &&
functionNode.parent.property.name === 'bind' &&
functionNode.parent.parent &&
functionNode.parent.parent.type === 'CallExpression' &&
functionNode.parent.parent.callee === functionNode.parent
) {
functionNode = functionNode.parent.parent
}
return functionNode && functionNode.parent && isPromise(functionNode.parent)
}

@@ -19,0 +38,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc