yaml-sort icon indicating copy to clipboard operation
yaml-sort copied to clipboard

Quotes added even without -f flag

Open bokub opened this issue 9 months ago • 1 comments

Hello !

I tried your tool on following file

answers:
  no: Non
  yes: Oui

When I run npx yaml-sort -w -1 -i ./fr.yml, it's transformed into the following:

answers:
  'no': Non
  'yes': Oui

Isn't the forceQuotes flag supposed to be false by default?

How can I prevent the quotes to be automatically added?

Thanks a lot

bokub avatar Apr 28 '25 12:04 bokub

It works as expected. In YAML specs, "yes" means true and is quoted by js-yaml if used as a key (have a look at noCompatMode option).

ddebin avatar Apr 28 '25 14:04 ddebin