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 Jul 31, 2019
@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

@SimenB SimenB Jul 31, 2019

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

Copy link
Collaborator Author

@G-Rath G-Rath Jul 31, 2019

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 approved these changes Jul 31, 2019
@SimenB SimenB merged commit 4a6d486 into master Jul 31, 2019
2 checks passed
@SimenB SimenB deleted the fix-357 branch Jul 31, 2019
@SimenB
Copy link
Member

@SimenB 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
Linked issues

Successfully merging this pull request may close these issues.

2 participants