diff --git a/lib/rules/callback-return.js b/lib/rules/callback-return.js index fa66e6383b7c..4d7bf2aa10e9 100644 --- a/lib/rules/callback-return.js +++ b/lib/rules/callback-return.js @@ -52,7 +52,7 @@ module.exports = { if (!node.parent) { return null; } - if (types.indexOf(node.parent.type) === -1) { + if (!types.includes(node.parent.type)) { return findClosestParentOfType(node.parent, types); } return node.parent; @@ -86,7 +86,7 @@ module.exports = { * @returns {boolean} Whether or not this function matches our callback name. */ function isCallback(node) { - return containsOnlyIdentifiers(node.callee) && callbacks.indexOf(sourceCode.getText(node.callee)) > -1; + return containsOnlyIdentifiers(node.callee) && callbacks.includes(sourceCode.getText(node.callee)); } /** diff --git a/lib/rules/comma-spacing.js b/lib/rules/comma-spacing.js index 73c10a7711b9..2bf41a00bb66 100644 --- a/lib/rules/comma-spacing.js +++ b/lib/rules/comma-spacing.js @@ -181,7 +181,7 @@ module.exports = { validateCommaItemSpacing({ comma: token, - left: astUtils.isCommaToken(previousToken) || commaTokensToIgnore.indexOf(token) > -1 ? null : previousToken, + left: astUtils.isCommaToken(previousToken) || commaTokensToIgnore.includes(token) ? null : previousToken, right: astUtils.isCommaToken(nextToken) ? null : nextToken }, token); });