Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] malformed package.json by explicitly setting jsonSyntax to strict #4813

Merged
merged 4 commits into from
Jul 1, 2024

Conversation

kenrick95
Copy link
Contributor

@kenrick95 kenrick95 commented Jun 27, 2024

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

Screenshot 2024-06-27 at 10 46 12

Impacted documentation

  • IJsonFileStringifyOptions adds "jsonSyntax" as an option. Is that okay?

kenrick95 and others added 2 commits June 28, 2024 09:04
Co-authored-by: David Michon <dmichon@microsoft.com>
Co-authored-by: David Michon <dmichon@microsoft.com>
@iclanton iclanton changed the title fix: malformed package.json by explicitly setting jsonSyntax to strict [rush] malformed package.json by explicitly setting jsonSyntax to strict Jul 1, 2024
@iclanton iclanton enabled auto-merge July 1, 2024 18:20
@iclanton iclanton merged commit eca9b73 into microsoft:main Jul 1, 2024
5 checks passed
@kenrick95 kenrick95 deleted the kenrick/fix-rush-add branch July 2, 2024 06:25
@octogonz
Copy link
Collaborator

🚀 Finally released with Rush 5.129.7 -- thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
5 participants