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

JS Doc type annotation moved inside of object after v0.13 #650

Open
michielpauw opened this issue Feb 26, 2025 · 0 comments
Open

JS Doc type annotation moved inside of object after v0.13 #650

michielpauw opened this issue Feb 26, 2025 · 0 comments

Comments

@michielpauw
Copy link

Hi! I noticed a strange change of behaviour from v0.14 onwards when using jscodeshift on this code snippet:

export default /** @type {SomeType} */ ({
  someProp: 'someProp',
});

I'm "transforming" this file as such:

const root = j.(fs.readFileSync(filepath, 'utf-8'));
return root.toSource();

Expected output

The code should not have changed

export default /** @type {SomeType} */ ({
  someProp: 'someProp',
});

This seems to be the case in v0.13 and before.

Actual output (from v0.14 onward)

export default ({
  /** @type {SomeType} */ someProp: 'someProp'
});
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

No branches or pull requests

1 participant