rushstack
rushstack copied to clipboard
fix: malformed package.json by explicitly setting jsonSyntax to strict
Summary
Attempt to fix #4811
Details
I investigated and found out that when saving JSON with "jju.update", it always use Json5 mode. This may cause issue when updating things that expect strict JSON like package.json.
So the fix here is to pass a jsonSyntax option to let PackageJsonEditor use that JsonSyntax.Strict mode.
How it was tested
I build locally and it works on the repro: https://github.com/kenrick95/rush-repro-rush-add-malformed-package-json
Impacted documentation
- IJsonFileStringifyOptions adds "jsonSyntax" as an option. Is that okay?