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

eslint-plugin-promise

Package Overview
Dependencies
Maintainers
1
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 3.4.0 to 3.4.1

2

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

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

@@ -51,3 +51,3 @@ # eslint-plugin-promise

"promise/no-promise-in-callback": "warn",
"promise/no-callback-in-promise: "warn",
"promise/no-callback-in-promise": "warn",
"promise/avoid-new": "warn"

@@ -112,6 +112,6 @@ }

This is useful for many non-standard Promise implementations.
You can also pass an array of methods such as
`{ terminationMethod: ['catch', 'asCallback', 'finally'] }`.
This will allow any of

@@ -118,0 +118,0 @@ ```js

@@ -88,3 +88,3 @@ function isFunctionWithBlockStatement (node) {

funcInfo.branchIDStack.push(segment.id)
funcInfo.branchInfoMap[segment.id] = {good: false, loc: node.loc}
funcInfo.branchInfoMap[segment.id] = {good: false, node: node}
},

@@ -124,3 +124,3 @@

message: 'Each then() should return a value or throw',
loc: branch.loc
node: branch.node
})

@@ -127,0 +127,0 @@ }

@@ -25,9 +25,11 @@ /**

if (isInPromise(context)) {
if (node.argument.type === 'CallExpression') {
if (node.argument.callee.type === 'MemberExpression') {
if (node.argument.callee.object.name === 'Promise') {
if (node.argument.callee.property.name === 'resolve') {
context.report(node, resolveMessage)
} else if (node.argument.callee.property.name === 'reject') {
context.report(node, rejectMessage)
if (node.argument) {
if (node.argument.type === 'CallExpression') {
if (node.argument.callee.type === 'MemberExpression') {
if (node.argument.callee.object.name === 'Promise') {
if (node.argument.callee.property.name === 'resolve') {
context.report(node, resolveMessage)
} else if (node.argument.callee.property.name === 'reject') {
context.report(node, rejectMessage)
}
}

@@ -34,0 +36,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