Invalid replace when output pattern has missing curly
tennox opened this issue · comments
Manuel commented
I found weird behaviour when I was missing a closing curly in my output pattern:
`const navigate = useNavigate()`
=> `const {locnav, location, navigate = useLocationNavigate()`
It didn't fail but weirdly removes a completely unrelated statement's const
prefix:
https://app.grit.io/studio?key=ndJC5UF8gvqYnDDY0urXP
I can see if that's a too weird edge-case and I should just fix my code, but I wanted to let you know in case you want to refine your UX 🤔
Morgante Pell commented
Thanks for the report. We have some matching heuristics around rewrites that this is capturing, but those heuristics are only really designed to work with well-structured rewrites.