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
Yarn config respect --no-defaults with --json (fixes#6341) (#6635)
## What's the problem this PR addresses?
As documented here https://yarnpkg.com/cli/config you would expect
`--no-defaults` to omit defaults even when `--json` is also specified.
This PR resolves#6341
## How did you fix it?
By respecting `noDefaults` in the `if (this.json) {` branch as well as
the `else`
## Checklist
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [ ] I have set the packages that need to be released for my changes to
be effective.
<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [ ] I will check that all automated PR checks pass before the PR gets
reviewed.
---------
Co-authored-by: Maël Nison <[email protected]>
{"key":"lastUpdateCheck","effective":"1555784893958","source":"WORKSPACE_ROOT/.yarnrc.yml","description":"Last timestamp we checked whether new Yarn versions were available","type":"STRING","default":null}
63
+
",
64
+
}
65
+
`;
66
+
36
67
exports[`Commands config test (folder with rcfile and rc in ancestor parent / as json) 1`] = `
37
68
{
38
69
"code": 0,
@@ -44,6 +75,23 @@ exports[`Commands config test (folder with rcfile and rc in ancestor parent / as
44
75
}
45
76
`;
46
77
78
+
exports[`Commands config test (folder with rcfile and rc in ancestor parent / no defaults) 1`] = `
{"key":"lastUpdateCheck","effective":"1555784893958","source":"WORKSPACE_ROOT/.yarnrc.yml","description":"Last timestamp we checked whether new Yarn versions were available","type":"STRING","default":null}
123
+
",
124
+
}
125
+
`;
126
+
69
127
exports[`Commands config test (folder with rcfile and rc in home folder / as json) 1`] = `
70
128
{
71
129
"code": 0,
@@ -77,6 +135,23 @@ exports[`Commands config test (folder with rcfile and rc in home folder / as jso
77
135
}
78
136
`;
79
137
138
+
exports[`Commands config test (folder with rcfile and rc in home folder / no defaults) 1`] = `
{"key":"lastUpdateCheck","effective":"1555784893958","source":"WORKSPACE_ROOT/subfolder/.yarnrc.yml","description":"Last timestamp we checked whether new Yarn versions were available","type":"STRING","default":null}
183
+
",
184
+
}
185
+
`;
186
+
102
187
exports[`Commands config test (folder with rcfile and rc in parent / as json) 1`] = `
103
188
{
104
189
"code": 0,
@@ -110,6 +195,23 @@ exports[`Commands config test (folder with rcfile and rc in parent / as json) 1`
110
195
}
111
196
`;
112
197
198
+
exports[`Commands config test (folder with rcfile and rc in parent / no defaults) 1`] = `
0 commit comments