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 :: in call expr comment causing crash #8117

Closed
wants to merge 2 commits into from

Conversation

thecodrr
Copy link
Contributor

@thecodrr thecodrr commented Apr 22, 2020

Fixes #7748

Prettier crashed when :: appeared in a call expression. This PR is supposed to fix that. The error is due to Prettier (wrongly) assuming that the comment is a Flow annotation. I have added a check against empty flow annotations which fixes it.

However, I can't seem to get the tests to pass. I have manually tested with both the CLI & the API (with all parsers) and it works. The playground works too but when I run the test suite with x(/* :: */[]); input, prettier automatically erases the comment. Don't know why. This happens even without my changes. @thorn0 would appreciate any help 😄

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/pr-XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@thorn0
Copy link
Member

thorn0 commented Apr 23, 2020

Unfortunately, can't help you with this. I don't have much time now, and Flow comment types are a mess.

Base automatically changed from master to main January 23, 2021 17:13
@thorn0
Copy link
Member

thorn0 commented Oct 24, 2022

superseded by #13687

@thorn0 thorn0 closed this Oct 24, 2022
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.

Error printing comment "::"
2 participants