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

feat: Add no-implicit-ref-callback-return transform #369

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

eps1lon
Copy link
Owner

@eps1lon eps1lon commented Mar 20, 2024

Closes #368

Copy link

changeset-bot bot commented Mar 20, 2024

🦋 Changeset detected

Latest commit: 47ac164

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

This PR includes changesets to release 1 package
Name Type
types-react-codemod 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

Copy link

changeset-bot bot commented Mar 20, 2024

🦋 Changeset detected

Latest commit: ebfb624

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

This PR includes changesets to release 1 package
Name Type
types-react-codemod 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

Comment on lines +18 to +22
if (
jsxAttribute.value?.type === "JSXExpressionContainer" &&
jsxAttribute.value.expression.type === "ArrowFunctionExpression" &&
jsxAttribute.value.expression.body.type !== "BlockStatement"
) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Ideally this would be part of the filter but this way TypeScript automatically knows what type we're dealing with.

@eps1lon eps1lon merged commit 7535bfc into main Mar 20, 2024
2 checks passed
@eps1lon eps1lon deleted the no-implicit-ref-callback-return branch March 20, 2024 22:39
@github-actions github-actions bot mentioned this pull request Mar 20, 2024
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.

Codemod for implict return in ref
1 participant