Closed kenn closed 1 month ago
Hi @kenn, thanks for writing in!
I generally agree with you that our wizard shouldn't format things differently to your preferred style.
However, we use recast
which already has quite a bit of logic built in to detect the format of the file it parses and apply the same format when writing the modfied AST back to the file.
It might be worth checking our recast settings to be sure we do our best here but other than that I believe it's unlikely that we'll ever be able to always apply the exact formatting style.
Worth noting that also the Astro CLI (which for me is the gold standard for code mod wizards) a lot of the time gets formatting wrong. It's a tricky problem to solve.
If you have concrete ideas to improve things, I'm always happy to review PRs. Leaving this open for the time being but as I said it's unlikely that we can do a lot here.
Got it. Prettier fixes it on save, so it's not a big deal. I just wanted to report in case it's missed, but feel free to close this issue!
We briefly discussed trying to detect if a project uses prettier and, if yes, running prettier from within the wizard. I think we didn't investigate this in greater detail due to time constraints but we could also revisit this idea.
That sounds like a good idea! Thanks @Lms24
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog
or Status: In Progress
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Environment
Sentry Wizard for Remix
Steps to Reproduce
npx @sentry/wizard@latest -i remix
Expected Result
It should make minimal changes to the original source, only add wrapper, unmodified anywhere else.
Actual Result
It also changes how new lines should be removed at each file, or add semicolon. Respect our preference. :)