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.
node.type_annotations
1 parent 51d342b commit 3e02d91Copy full SHA for 3e02d91
lib/rules/sort-prop-types.js
@@ -230,7 +230,7 @@ module.exports = {
230
}
231
232
function handleFunctionComponent(node) {
233
- const firstArg = node.params[0].typeAnnotation && node.params[0].typeAnnotation.typeAnnotation;
+ const firstArg = node.params && node.params.length > 0 && node.params[0].typeAnnotation && node.params[0].typeAnnotation.typeAnnotation;
234
if (firstArg && firstArg.type === 'TSTypeReference') {
235
const propType = typeAnnotations.get(firstArg.typeName.name)
236
&& typeAnnotations.get(firstArg.typeName.name)[0];
0 commit comments