File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
18
18
* [ Refactor] ` propTypes ` : extract type params to var ([ #3634 ] [ ] @HenryBrown0 )
19
19
* [ Refactor] [ ` boolean-prop-naming ` ] : invert if statement ([ #3634 ] [ ] @HenryBrown0 )
20
20
* [ Refactor] [ ` function-component-definition ` ] : exit early if no type params ([ #3634 ] [ ] @HenryBrown0 )
21
+ * [ Refactor] [ ` jsx-props-no-multi-spaces ` ] : extract type parameters to var ([ #3634 ] [ ] @HenryBrown0 )
21
22
22
23
[ #3638 ] : https://github.com/jsx-eslint/eslint-plugin-react/pull/3638
23
24
[ #3634 ] : https://github.com/jsx-eslint/eslint-plugin-react/pull/3634
Original file line number Diff line number Diff line change @@ -98,8 +98,12 @@ module.exports = {
98
98
}
99
99
100
100
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' ;
103
107
}
104
108
105
109
function getGenericNode ( node ) {
You can’t perform that action at this time.
0 commit comments