Skip to content

Commit

Permalink
refactor: code
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Dec 13, 2021
1 parent 95e7cd3 commit 52b954c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/rules/prefer-object-has-own.js
Expand Up @@ -94,7 +94,10 @@ module.exports = {
const tokenJustBeforeNode = sourceCode.getTokenBefore(node.callee, { includeComments: true });

// for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335
if (tokenJustBeforeNode && !astUtils.canTokensBeAdjacent(tokenJustBeforeNode, "Object.hasOwn") && !sourceCode.isSpaceBetween(node.callee, tokenJustBeforeNode)) {
if (tokenJustBeforeNode &&
!astUtils.canTokensBeAdjacent(tokenJustBeforeNode, "Object.hasOwn") &&
!sourceCode.isSpaceBetween(node.callee, tokenJustBeforeNode)
) {
return fixer.replaceText(node.callee, " Object.hasOwn");
}

Expand Down

0 comments on commit 52b954c

Please sign in to comment.