Skip to content

Commit 37fb401

Browse files
committed
Ensure "$schema" is sorted properly for ApprovedPackagesConfiguration.ts
1 parent 21034e4 commit 37fb401

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/rush-lib/src/api/ApprovedPackagesConfiguration.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export class ApprovedPackagesConfiguration {
6767
public clear(): void {
6868
this._itemsByName.clear();
6969
this._loadedJson = {
70+
// Ensure this comes first in the key ordering
71+
$schema: '',
7072
packages: []
7173
};
7274
}
@@ -149,7 +151,7 @@ export class ApprovedPackagesConfiguration {
149151
}
150152

151153
// Save the file
152-
let body: string = JSON.stringify(this._loadedJson, undefined, 2) + '\n';
154+
let body: string = JsonFile.stringify(this._loadedJson);
153155

154156
// Unindent the allowedCategories array to improve readability
155157
body = body.replace(

0 commit comments

Comments
 (0)