eslint-plugin-promise
Advanced tools
Comparing version 3.4.0 to 3.4.1
{ | ||
"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 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24844
495