Skip to content

Commit

Permalink
refactor: extract type parameters to var
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryBrown0 committed Sep 24, 2023
1 parent c21cfb0 commit 66c674d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/rules/jsx-props-no-multi-spaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ module.exports = {
}

function containsGenericType(node) {
const containsTypeParams = typeof node.typeParameters !== 'undefined';
return containsTypeParams && node.typeParameters.type === 'TSTypeParameterInstantiation';
const nodeTypeParams = node.typeParameters;
if (typeof nodeTypeParams === 'undefined') {
return false;
}

return nodeTypeParams.type === 'TSTypeParameterInstantiation';
}

function getGenericNode(node) {
Expand Down

0 comments on commit 66c674d

Please sign in to comment.