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

🐛 Bug: curly is changed even in prettier-ignore block #625

Open
3 tasks done
HolgerJeromin opened this issue Dec 19, 2024 · 3 comments
Open
3 tasks done

🐛 Bug: curly is changed even in prettier-ignore block #625

HolgerJeromin opened this issue Dec 19, 2024 · 3 comments
Labels
status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(

Comments

@HolgerJeromin
Copy link

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

This should be kept verbatim:

// prettier-ignore
function ignored() {
    if(foo  .bar)
        return
}

Actual

The code is changed to:

// prettier-ignore
function ignored() {
    if(foo.bar){
return}
}

Additional Info

Perhaps this is a bug in prettier that no plugins should be called in ignored code...
I am happy to report it over there if you are not able to transfer.

@HolgerJeromin HolgerJeromin added the type: bug Something isn't working :( label Dec 19, 2024
@JoshuaKGoldberg
Copy link
Owner

Yeah I'm not sure whose responsibility it is to handle these comments. My hunch is that at the very least this is a documentation issue on Prettier core. There's no recommendation I could find -e.g. in https://prettier.io/docs/en/plugins.html- on the "right" way to do it. Yes please on the reporting it over there. 🙂

@HolgerJeromin
Copy link
Author

Reported as prettier/prettier#16951

@JoshuaKGoldberg
Copy link
Owner

Thanks to prettier/prettier#16951 (comment), it looks like we have a preferred solution: switching this plugin to overwrite the estree plugin's printer.print. Accepting PRs!

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! and removed status: blocked Waiting for something else to be resolved labels Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(
Projects
None yet
Development

No branches or pull requests

2 participants