File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
libraries/rush-lib/src/api Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -828,7 +828,7 @@ export class RushConfiguration {
828
828
} else if (
829
829
! this . subspacesFeatureEnabled &&
830
830
rushConfigurationJson . ensureConsistentVersions !== undefined &&
831
- this . defaultSubspace . getCommonVersions ( ) . ensureConsistentVersions
831
+ this . defaultSubspace . getCommonVersions ( ) . ensureConsistentVersions !== undefined
832
832
) {
833
833
throw new Error (
834
834
`When the ensureConsistentVersions config is defined in the ${ RushConstants . rushJsonFilename } file, ` +
Original file line number Diff line number Diff line change @@ -276,10 +276,12 @@ export class Subspace {
276
276
* @beta
277
277
*/
278
278
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 ;
283
285
}
284
286
285
287
// Fallback to ensureConsistentVersions in rush.json if subspaces is not enabled,
You can’t perform that action at this time.
0 commit comments