diff --git a/package.json b/package.json index 00f1df64..96a3ae75 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "devDependencies": { "eslint": "^3.0", "mocha": "^2.3.4", - "standard": "^7.1.2" + "standard": "^10.0.3" }, "engines": { "node": ">=4" diff --git a/rules/lib/is-inside-promise.js b/rules/lib/is-inside-promise.js index 6f08e208..7c8c0e1d 100644 --- a/rules/lib/is-inside-promise.js +++ b/rules/lib/is-inside-promise.js @@ -1,9 +1,9 @@ function isInsidePromise (node) { var isFunctionExpression = node.type === 'FunctionExpression' || - node.type === 'ArrowFunctionExpression' + node.type === 'ArrowFunctionExpression' var parent = node.parent || {} var callee = parent.callee || {} - var name = callee.property && callee.property.name || '' + var name = (callee.property && callee.property.name) || '' var parentIsPromise = name === 'then' || name === 'catch' var isInCB = isFunctionExpression && parentIsPromise return isInCB diff --git a/rules/prefer-await-to-callbacks.js b/rules/prefer-await-to-callbacks.js index 628ea188..56c420fc 100644 --- a/rules/prefer-await-to-callbacks.js +++ b/rules/prefer-await-to-callbacks.js @@ -30,7 +30,7 @@ module.exports = function (context) { var args = node.arguments var num = args.length - 1 var arg = num > -1 && node.arguments && node.arguments[num] - if (arg && arg.type === 'FunctionExpression' || arg.type === 'ArrowFunctionExpression') { + if (arg && (arg.type === 'FunctionExpression' || arg.type === 'ArrowFunctionExpression')) { if (arg.params && arg.params[0] && arg.params[0].name === 'err') { if (!isInsideYieldOrAwait()) { context.report(arg, errorMessage)