8000 Make consistent versions clearer · microsoftly/rushstack@615ed0b · GitHub
[go: up one dir, main page]

Skip to content

Commit 615ed0b

Browse files
committed
Make consistent versions clearer
1 parent adb8ac4 commit 615ed0b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

libraries/rush-lib/src/api/RushConfiguration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ export class RushConfiguration {
828828
} else if (
829829
!this.subspacesFeatureEnabled &&
830830
rushConfigurationJson.ensureConsistentVersions !== undefined &&
831-
this.defaultSubspace.getCommonVersions().ensureConsistentVersions
831+
this.defaultSubspace.getCommonVersions().ensureConsistentVersions !== undefined
832832
) {
833833
throw new Error(
834834
`When the ensureConsistentVersions config is defined in the ${RushConstants.rushJsonFilename} file, ` +

libraries/rush-lib/src/api/Subspace.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,12 @@ export class Subspace {
276276
* @beta
277277
*/
278278
public get shouldEnsureConsistentVersions(): boolean {
279-
const subspaceEnsureConsistentVersions: boolean =
280-
this.getCommonVersions().ensureConsistentVersions !== undefined;
281-
if (this._rushConfiguration.subspacesFeatureEnabled || subspaceEnsureConsistentVersions) {
282-
return subspaceEnsureConsistentVersions;
279+
// If the subspaces feature is enabled, or the ensureConsistentVersions field is defined, return the value of the field
280+
if (
281+
this._rushConfiguration.subspacesFeatureEnabled &&
282+
this.getCommonVersions().ensureConsistentVersions !== undefined
283+
) {
284+
return !!this.getCommonVersions().ensureConsistentVersions;
283285
}
284286

285287
// Fallback to ensureConsistentVersions in rush.json if subspaces is not enabled,

0 commit comments

Comments
 (0)
0