prettier
prettier copied to clipboard
Improve string print perfomance
Description
We already stop unescaping characters in #16563.
It makes sense to skip makeString() when the original quote matches the desired quote.
However, this will make the following code
const foo = "\"\'"
untouched when using --no-single-quote, but unescape " when using --single-quote.
I think it's acceptable. What do you think? @sosukesuzuki @kachkaev
Checklist
- [x] I’ve added tests to confirm my change works.
- [x] (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/*/XXXX.mdfile followingchangelog_unreleased/TEMPLATE.md. - [x] I’ve read the contributing guidelines.