dprint-plugin-typescript
dprint-plugin-typescript copied to clipboard
Support for quote style of template literal strings
This was rejected in prettier, would love to see it here. https://github.com/prettier/prettier/issues/54
So currently for "quoteStyle" there is:
- alwaysDouble
- alwaysSingle
- preferDouble
- preferSingle
I think we could add:
- alwaysTemplate (or maybe alwaysBacktick to follow eslint terminology, though I think "template" is already used elsewhere in the config so it would be better for consistency)
This would not apply to "jsx.quoteStyle".
How about a "avoidEscape" equivalent ? https://eslint.org/docs/latest/rules/quotes#options
We use preferSingle, but sometimes a backtick is needed to avoid escaping both ' and " in a string.
Then I could turn off yet another ESLint rule (the more rules are off, the faster it runs) and let dprint completely take care of quotes.
So currently for "quoteStyle" there is:
- alwaysDouble
- alwaysSingle
- preferDouble
- preferSingle
I think we could add:
- alwaysTemplate (or maybe alwaysBacktick to follow eslint terminology, though I think "template" is already used elsewhere in the config so it would be better for consistency)
This would not apply to "jsx.quoteStyle".
How about, as well as adding alwaysTemplate, we add preferTemplate - to be used when the string needs escaping?