Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Option to keep use |- while using forceQuotes #726

Open
rinsuki opened this issue Dec 29, 2024 · 0 comments
Open

Feature Request: Option to keep use |- while using forceQuotes #726

rinsuki opened this issue Dec 29, 2024 · 0 comments

Comments

@rinsuki
Copy link

rinsuki commented Dec 29, 2024

personally I prefer to use quotes for string in YAML, rather than raw strings, to keep avoid confuses around number, like this:

app:
  version: 1.2.3 # => string
pg:
  version: 15.2 # => edited by human and now its number, but unexpected...

in js-yaml, this can be done with forceQuotes option for yaml.dump(), but this also disables |- syntax.

app:
  version: '1.2.3' # this is string, really clear
  startup: "#!/bin/bash\n# doing something\n# also doing something..." # ... hard to read

since | defines they are always string (like quotes does), it would be good to have option to also allow their (aka just simply disallows implicit string literal)

Expected Result:

app:
  version: '1.2.3'
  startup: |-
    #!/bin/bash
    # doing something
    # also doing something...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant