Skip to content

[Bug?]: yarn config set reformats quoting in .yarnrc.yml #7045

@GideonPARANOID

Description

@GideonPARANOID

Self-service

  • I'd be willing to implement a fix

Describe the bug

I have a .yarnrc.yml which matches the rest of our project's style rules - using single quotes by default.

However, when setting additional config in the file via yarn config set, the quoting gets changed for all properties.

This is problematic in CI in my projects, as we need to set auth tokens from CI secrets storage, & then linting is ran, which fails due to the change in format style.

To reproduce

[gideonparanoid]:[~/workspace/node]:[main] cat .yarnrc.yml
npmScopes:
  test:
    npmRegistryServer: 'https://test.com'
[gideonparanoid]:[~/workspace/node]:[main] yarn config set "npmRegistries['//test.com'].npmAuthToken" 'value'
➤ YN0000: Successfully set npmRegistries["//test.com"].npmAuthToken to '********'
[gideonparanoid]:[~/workspace/node]:[main] cat .yarnrc.yml
npmRegistries:
  //test.com:
    npmAuthToken: value

npmScopes:
  test:
    npmRegistryServer: "https://test.com"

Environment

System:
    OS: macOS 26.0.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 24.11.1 - /private/var/folders/4d/cfz93ltx1hj8sd0gnnq7mvlc0000gn/T/xfs-ca46317a/node
    Yarn: 4.12.0 - /private/var/folders/4d/cfz93ltx1hj8sd0gnnq7mvlc0000gn/T/xfs-ca46317a/yarn
    npm: 11.6.2 - /Users/Gideon.Jones/.nvm/versions/node/v24.11.1/bin/npm

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions