Skip to content

Commit

Permalink
fix: handle the case where superTypeParameters is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Nov 12, 2019
1 parent 45ee910 commit 9b046e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/requireReadonlyReactProps.js
Expand Up @@ -27,7 +27,7 @@ const create = (context) => {
const reportedFunctionalComponents = [];

const isReadOnlyClassProp = (node) => {
const id = node.superTypeParameters.params[0].id;
const id = node.superTypeParameters && node.superTypeParameters.params[0].id;

return id && !reReadOnly.test(id.name) && !readOnlyTypes.includes(id.name) && foundTypes.includes(id.name);
};
Expand Down

0 comments on commit 9b046e4

Please sign in to comment.