Skip to content

feat: implement stores-no-async #225

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

Merged
merged 9 commits into from
Aug 23, 2022

Conversation

baseballyama
Copy link
Member

@baseballyama baseballyama commented Aug 14, 2022

Related to: #198 (stores-no-async)

This is the first ESLint rule I have written.
(So I'm sorry if I have a wrong understanding.)
I would be very grateful if you would review it.

@changeset-bot
Copy link

changeset-bot bot commented Aug 14, 2022

🦋 Changeset detected

Latest commit: 0b8b4ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-svelte Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 14, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!
I think it works mostly fine already, but I have some change requests to address some edge cases.

if (name !== "writable" && name !== "readable" && name !== "derived")
return
const [, fn] = node.arguments
if (fn.type !== "ArrowFunctionExpression" || !fn.async) return
Copy link
Member

Choose a reason for hiding this comment

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

I think we should check if the argument exists.

Suggested change
if (fn.type !== "ArrowFunctionExpression" || !fn.async) return
if (!fn || fn.type !== "ArrowFunctionExpression" || !fn.async) return

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed! Sorry for that!

99e0996

@baseballyama baseballyama requested a review from ota-meshi August 20, 2022 10:11
@baseballyama
Copy link
Member Author

@ota-meshi

Thank you for your review!
I updated the PR according to your comments!
Could you please check it again? Thank you!

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@ota-meshi ota-meshi requested review from JounQin and tivac August 22, 2022 09:00
Copy link
Collaborator

@JounQin JounQin left a comment

Choose a reason for hiding this comment

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

I don't see anything strange. LGTM! 🍺

@ota-meshi ota-meshi merged commit a3888b3 into sveltejs:main Aug 23, 2022
@ota-meshi
Copy link
Member

Thank you for your contribution!

@baseballyama baseballyama deleted the feature/stores-no-async branch August 23, 2022 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants