Skip to content

Commit

Permalink
Use type assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
y-hsgw committed Apr 13, 2024
1 parent aa96591 commit e2c3497
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rules/jsx-no-bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ module.exports = {
const blockAncestors = getBlockStatementAncestors();
const variableViolationType = getNodeViolationType(node.init);

const nodeParent = /** @type {import("estree").VariableDeclaration} */(node.parent);
if (
blockAncestors.length > 0
&& variableViolationType
&& node.parent.type === 'VariableDeclaration'
&& node.parent.kind === 'const' // only support const right now
&& nodeParent.kind === 'const' // only support const right now
&& node.id.type === 'Identifier'
) {
addVariableNameToSet(
Expand Down

0 comments on commit e2c3497

Please sign in to comment.