Skip to content

Commit 96277ef

Browse files
alan-agius4clydin
authored andcommitted
fix(@schematics/angular): allow trailing commas in JSON files
Currently, both tsconfigs and workspace configuration files can contain trailing commas Closes #19576 (cherry picked from commit 07e3766)
1 parent 9bcf7a9 commit 96277ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/schematics/angular/utility/json-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class JSONFile {
3636
}
3737

3838
const errors: ParseError[] = [];
39-
this._jsonAst = parseTree(this.content, errors);
39+
this._jsonAst = parseTree(this.content, errors, { allowTrailingComma: true });
4040
if (errors.length) {
4141
const { error, offset } = errors[0];
4242
throw new Error(`Failed to parse "${this.path}" as JSON AST Object. ${printParseErrorCode(error)} at location: ${offset}.`);

0 commit comments

Comments
 (0)