diff --git a/lib/util/usedPropTypes.js b/lib/util/usedPropTypes.js index 376818fae4..f1ac14622c 100755 --- a/lib/util/usedPropTypes.js +++ b/lib/util/usedPropTypes.js @@ -339,6 +339,8 @@ module.exports = function usedPropTypesInstructions(context, components, utils) type = 'destructuring'; properties = node.properties; break; + case 'TSEmptyBodyFunctionExpression': + break; default: throw new Error(`${node.type} ASTNodes are not handled by markPropTypesAsUsed`); } diff --git a/tests/lib/rules/no-unused-prop-types.js b/tests/lib/rules/no-unused-prop-types.js index 8c216e85ea..cd4fa5f0f7 100644 --- a/tests/lib/rules/no-unused-prop-types.js +++ b/tests/lib/rules/no-unused-prop-types.js @@ -3202,6 +3202,15 @@ ruleTester.run('no-unused-prop-types', rule, { } `, parser: parsers.TYPESCRIPT_ESLINT + }, + { + code: [ + 'declare class Thing {', + ' constructor({ id }: { id: string });', + '}', + 'export default Thing;' + ].join('\n'), + parser: parsers.TYPESCRIPT_ESLINT } ],