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: support ChainExpression in await-interactions rule #87

Merged

Conversation

VinceMalone
Copy link

Issue: #86

What Changed

in existing use-cases of the await-interactions rule, the code is assumed to be valid when the CallExpression node is the immediate child of an AwaitExpression node.

await FirstStory.play(context); → AwaitExpression > CallExpression > …

await FirstStory.play!(context); → AwaitExpression > CallExpression > TSNonNullExpression > …

to support an expression with an optional chain, the logic to determine if the expression was properly awaited now checks if the parent of the parent of the CallExpression node is an AwaitExpression.

await FirstStory.play?.(context); → AwaitExpression > ChainExpression > CallExpression > …

Checklist

Check the ones applicable to your change:

  • Ran yarn update-all
  • Tests are updated
  • Documentation is updated

Change Type

Indicate the type of change your pull request is:

  • maintenance
  • documentation
  • patch
  • minor
  • major

@yannbf
Copy link
Member

yannbf commented Apr 15, 2022

Thank you so much for your contribution @VinceMalone !! I added a small fix and this is good to go.
Before merging though, would you like to edit your author email from your commit? Seems as if it's not set and I think this might end up not adding you as a contributor to this project as a result.

Thank you!

@VinceMalone
Copy link
Author

thanks @yannbf. I think I fixed the email; lemme know if it's still not working.

@yannbf
Copy link
Member

yannbf commented Apr 15, 2022

thanks @yannbf. I think I fixed the email; lemme know if it's still not working.

It's perfect now! Thanks once again, for using this library and for making it better!

@yannbf yannbf added the patch Increment the patch version when merged label Apr 15, 2022
@yannbf yannbf merged commit ce04910 into storybookjs:main Apr 15, 2022
@github-actions
Copy link

🚀 PR was released in v0.5.9 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Apr 15, 2022
@yannbf yannbf added the linear label Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants