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

Conversation

@guillaumewuip
Copy link
Contributor

guillaumewuip commented Feb 1, 2020

Fixes #2559

…SEmptyBodyFunctionExpression` AST node

Fixes #2559.
@ljharb ljharb added the typescript label Feb 1, 2020
Copy link
Collaborator

ljharb left a comment

Please add a regression test for this.

@guillaumewuip

This comment has been minimized.

Copy link
Contributor Author

guillaumewuip commented Feb 2, 2020

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

guillaumewuip commented Feb 9, 2020

@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
@guillaumewuip guillaumewuip requested a review from ljharb Feb 9, 2020
@ljharb
ljharb approved these changes Feb 9, 2020
@ljharb ljharb merged commit b517b9e into yannickcr:master Feb 9, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.0005%) to 97.583%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.