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

Fix crash on TSEmptyBodyFunctionExpression AST node #2560

Merged
merged 1 commit into from Feb 9, 2020
Merged

Fix crash on TSEmptyBodyFunctionExpression AST node #2560

merged 1 commit into from Feb 9, 2020

Conversation

guillaumewuip
Copy link
Contributor

Fixes #2559

…SEmptyBodyFunctionExpression` AST node

Fixes #2559.
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a regression test for this.

@guillaumewuip
Copy link
Contributor Author

Ok, no problem 👍

I'm not sure about how to test this correctly. As far as I understand the test suite, usedPropTypesInstructions is not tested yet.

Should I add a test for usedPropTypesInstructions mocking context, components and utils params ?

@golopot
Copy link
Contributor

golopot commented Feb 5, 2020

The test should contain the code that make this plugin crash, and written like ones in tests/lib/rules/no-unused-prop-types.js.

@guillaumewuip
Copy link
Contributor Author

@ljharb @golopot I've added one test. Let me know if it's ok for you

tests/util/usedPropTypes.js Outdated Show resolved Hide resolved
@ljharb ljharb merged commit b517b9e into jsx-eslint:master Feb 9, 2020
@NathanKleekamp
Copy link

Any idea when a new release with this merged PR will go out?

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

Successfully merging this pull request may close these issues.

Crash on TSEmptyBodyFunctionExpression AST node
4 participants