Skip to content

Commit 32cb6e2

Browse files
HenryBrown0ljharb
authored andcommitted
refactor: extract type parameters to var
1 parent d77caa5 commit 32cb6e2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/rules/jsx-props-no-multi-spaces.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,12 @@ module.exports = {
9898
}
9999

100100
function containsGenericType(node) {
101-
const containsTypeParams = typeof node.typeParameters !== 'undefined';
102-
return containsTypeParams && node.typeParameters.type === 'TSTypeParameterInstantiation';
101+
const nodeTypeParams = node.typeParameters;
102+
if (typeof nodeTypeParams === 'undefined') {
103+
return false;
104+
}
105+
106+
return nodeTypeParams.type === 'TSTypeParameterInstantiation';
103107
}
104108

105109
function getGenericNode(node) {

0 commit comments

Comments
 (0)