We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe9e09f commit d77caa5Copy full SHA for d77caa5
lib/rules/function-component-definition.js
@@ -33,14 +33,12 @@ const UNNAMED_FUNCTION_TEMPLATES = {
33
};
34
35
function hasOneUnconstrainedTypeParam(node) {
36
- if (node.typeParameters) {
37
- return (
38
- node.typeParameters.params.length === 1
39
- && !node.typeParameters.params[0].constraint
40
- );
+ const nodeTypeParams = node.typeParameters;
+ if (!nodeTypeParams) {
+ return false;
41
}
42
43
- return false;
+ return nodeTypeParams.params.length === 1 && !nodeTypeParams.params[0].constraint;
44
45
46
function hasName(node) {
0 commit comments