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

methodName: ensure method(node) returns truthy before trying to use return #358

Merged
merged 4 commits into from Jul 31, 2019

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Jul 31, 2019

Fixes #357

It's a simple quick fix, as the underlying problem is fixed by the upcoming ts conversation stuff.

@G-Rath G-Rath requested a review from SimenB July 31, 2019 02:41
@G-Rath G-Rath changed the title methodName: ensure method(node) returns truthy before trying to use return/ methodName: ensure method(node) returns truthy before trying to use return Jul 31, 2019
@@ -87,7 +87,7 @@ export const method = node => node.parent.property;

export const method2 = node => node.parent.parent.property;

const methodName = node => method(node).name;
const methodName = node => method(node) && method(node).name;

const methodName2 = node => method2(node).name;
Copy link
Member

Choose a reason for hiding this comment

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

Same here? expect(something).not; or something like that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could do - I don't think it's needed per say b/c all the rules that use it check using method first, but I'll add it in anyway :)

@SimenB SimenB merged commit 4a6d486 into master Jul 31, 2019
@SimenB SimenB deleted the fix-357 branch July 31, 2019 08:43
@SimenB
Copy link
Member

SimenB commented Jul 31, 2019

🎉 This PR is included in version 22.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Crashes when expect with no following statement.
2 participants