Even if it could maintain the same one after a transformation, in our case we're often inserting new nodes. Ideally recast would be able to infer which quote to use based on context in the file or something like that, but that sounds advanced beyond its capabilities right now.
For now, I'm defaulting it to use single quotes.
We have a few options:
not fix this right now (lol)
suggest that consumers subsequently use their linter's --fix option after running this if it's the wrong quote style
more work: make the quote option we send to recast easy to pass in when running the command (this would probably be easier with codemod-cli 🤔)
It seems like
recast
'forgets' the quotes used.Even if it could maintain the same one after a transformation, in our case we're often inserting new nodes. Ideally recast would be able to infer which quote to use based on context in the file or something like that, but that sounds advanced beyond its capabilities right now.
For now, I'm defaulting it to use single quotes.
We have a few options:
--fix
option after running this if it's the wrong quote stylequote
option we send torecast
easy to pass in when running the command (this would probably be easier with codemod-cli 🤔)