We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcd12ac commit d08f761Copy full SHA for d08f761
lib/rules/function-component-definition.js
@@ -34,11 +34,11 @@ const UNNAMED_FUNCTION_TEMPLATES = {
34
35
function hasOneUnconstrainedTypeParam(node) {
36
const nodeTypeParams = node.typeParameters;
37
- if (!nodeTypeParams) {
38
- return false;
39
- }
40
41
- return nodeTypeParams.params.length === 1 && !nodeTypeParams.params[0].constraint;
+ return nodeTypeParams
+ && nodeTypeParams.params
+ && nodeTypeParams.params.length === 1
+ && !nodeTypeParams.params[0].constraint;
42
}
43
44
function hasName(node) {
0 commit comments