You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I set quotes=preferSingle, the formatter outputs:
some_string: 'This isn''t working'
Even though the docs say that the opposite quote style is used to avoid extra escapes:
"preferDouble" - Use double quotes as possible. However if there're escaped characters in strings, quotes will be kept as-is. (Recommended) (Default)
"preferSingle" - Use single quotes as possible. However if there're \ char or " char in strings, quotes will be kept as-is.
Sounds reasonable. I'm going to change the behavior of preferSingle/preferDouble and add alwaysSingle/alwaysDouble options, but the default option value will still be preferDouble.
I have YAML like:
If I set
quotes=preferSingle
, the formatter outputs:Even though the docs say that the opposite quote style is used to avoid extra escapes:
Current behavior: https://dprint.dev/playground/#code/G4QwNgrgpgXABAcgBJTGA9gQgQWAFD6iRQBM8ARACoAWAlgM5wMB2CALnCHALZT30gA5lAB05IA/config/N4WAUABBBEAOBOBLAdgFwOqICaoBbQC4IAOABgBpwpoBXAZwFMAVAQwCM7CIAzFgG0aVIMFFgZpMOfEQBMQ6nxQMAQvAYsA1l2h9u0eTACONAPaoGnInDXcG8AMooA5nwb6qMVPBaJFyJwDCJgC2wSxcXjQMBtDcJvBhqEGh4qiWPPyCHtCiqcp8JgDGGvYMxuKFDACSyACyLLAR8FExbN6V9rAshc5NLdlt3RoMqJ3dvUS8AtHZXojBTN6+zui4iOZ0XZXpkTPC0HMLS35OAFp2JlxTWfuITsjxDMnBqQAiiGqFqIgAbm5WCBGqAAngBaYEsYJ8UF3B5qaDgAC+4CAA/plugin/pretty_yaml
What I would expect (e.g. prettierish): https://prettier.io/playground/#N4Igxg9gdgLgprEAuEA3AhgGwK5yQAgHIAJOTTCAQkIB0o6Mc4AmAmkAFQAsBLAZ3z8ohGPnT4AtnD590AczgA6diAA0ICAAcYPaH2Sh0AJyMQA7gAVjCfSixn0AT33qARkfRgA1nBgBldCkAGR4oOGQAMyw+ODcPb18-TU9QuWQYI1x1GIkedMzYkDgAD004Ix4pWCwOcqhjHmlI6MK+VMw4AEVsCHh8rJAAKz5iv3aunr6kKMwY9QBHSbgLU01bEHQ+AFowuAATfbUQDPQeTFSAYQgJCXRkDfIjtqg5DoBBGAyeV2x4C3KQmFmrNClwYBJMAB1XjwPjJMBwPw2Hg6VAoxz3MAyI6oXAASSgB1gfjAFW0b0Jfhgjg6wLmIE0phikI8mnujOk5VQ4XUoRiRhgK3ktzphWSRn590cgUwR0ZoRgkJ4exgXGQAA4AAzqIxwRY8XVCuQi6YtdQwdCuJUqtVIZjqbAxDiW2wzelwCSufYHPZBdAvbDyOAAMQgRlun1S93QvwgIAAvvGgA
A code example: microsoft/TypeScript@main...jakebailey:TypeScript:pretty-yaml
The text was updated successfully, but these errors were encountered: