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

Our codemod unit test in v11 fail because they expect an extra parentheses #3084

Closed
mannycarrera4 opened this issue Dec 20, 2024 · 1 comment
Labels
11.x bug Something isn't working

Comments

@mannycarrera4
Copy link
Contributor

mannycarrera4 commented Dec 20, 2024

🐛 Bug Report

Issue is highlighted in this open ticket in jscodeshift. Although not an explicit issue with jscodeshift bur rather recast, the suggested solution was to downgrade recast via resolutions.

All our codemod unit tests fail expecting an extra parentheses in the return statement.

expected output

import * as React from "react";

export default function WrappedLink(props) {
  return (
    <div data-foo="bar">
      <a {...props} data-foo="bar" />
    </div>
  );
}

actual output

import * as React from "react";

export default function WrappedLink(props) {
  return (
    (<div data-foo="bar">
      <a {...props} data-foo="bar" />
    </div>)
  );
}

Actual output should have no parentheses.

@mannycarrera4 mannycarrera4 added the bug Something isn't working label Dec 20, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Canvas Kit Dec 20, 2024
alanbsmith pushed a commit that referenced this issue Dec 20, 2024
Fixes: #3084

Based on an [open issue in jscodeshift](facebook/jscodeshift#534), `recast` seems to be adding an extra parens in the return call in our unit tests. One of the suggested solutions was to downgrade `recast`. In v12, this has been fixed, but adding this resolution for v11.

[category:Dependencies]

Co-authored-by: manuel.carrera <[email protected]>
@mannycarrera4
Copy link
Contributor Author

resolved in #3083

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Canvas Kit Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11.x bug Something isn't working
Projects
Status: ✅ Done
Development

No branches or pull requests

1 participant