Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on TSEmptyBodyFunctionExpression AST node #2559

Closed
guillaumewuip opened this issue Feb 1, 2020 · 0 comments · Fixed by #2560
Closed

Crash on TSEmptyBodyFunctionExpression AST node #2559

guillaumewuip opened this issue Feb 1, 2020 · 0 comments · Fixed by #2560

Comments

@guillaumewuip
Copy link
Contributor

I use eslint-config-airbnb-typescript. When linting the file copied below, eslint crash with this error:

Error: TSEmptyBodyFunctionExpression ASTNodes are not handled by markPropTypesAsUsed
Occurred while linting .../a/Thing.d.ts:2
    at markPropTypesAsUsed (.../node_modules/eslint-plugin-react/lib/util/usedPropTypes.js:335:15)
    at ObjectPattern (.../node_modules/eslint-plugin-react/lib/util/usedPropTypes.js:526:9)
    at updatedRuleInstructions.(anonymous function) (.../node_modules/eslint-plugin-react/lib/util/Components.js:886:47)
    at listeners.(anonymous function).forEach.listener (.../node_modules/eslint/lib/linter/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (.../node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (.../node_modules/eslint/lib/linter/node-event-generator.js:254:26)
    at NodeEventGenerator.applySelectors (.../node_modules/eslint/lib/linter/node-event-generator.js:283:22)
    at NodeEventGenerator.enterNode (.../node_modules/eslint/lib/linter/node-event-generator.js:297:14)
    at CodePathAnalyzer.enterNode (.../node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:634:23)

File to reproduce:

// Thing.d.ts
declare class Thing {
  constructor({ id }: { id: string });
}

export default Thing;

eslint version: 6.8.0
eslint-plugin-react version: 7.16.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant