feat: don't quote valid IdentifierNames in pretty json of PnP hook#3965
feat: don't quote valid IdentifierNames in pretty json of PnP hook#3965paul-soporan wants to merge 1 commit intomasterfrom
IdentifierNames in pretty json of PnP hook#3965Conversation
merceyz
left a comment
There was a problem hiding this comment.
If we don't quote them it isn't a valid JSON string anymore so I don't think we should do this.
|
It's not valid JSON on master either because of trailing commas and we currently use |
|
I've noticed that as well and have a branch fixing it but haven't gotten around to making a PR yet |
|
Ah, I was intending to implement a "strict JSON mode" in a future PR (gating both of these things that make it invalid JSON behind it) so that we can use |
|
The reason I wanted it to be a valid JSON string is because I was working on using With that backstory out of the way, since the function is private we could rename it and my objection would be gone assuming the lack of quotes doesn't affect the startup time 👍 Footnotes |
What's the problem this PR addresses?
Reading the serialized state inside of the PnP hook is more painful than it has to be because all object properties are quoted even when they don't need to be, and most themes use the same color for quoted object keys and quoted object values [citation needed].
How did you fix it?
Made
generatePrettyJsonskip quoting keys when it's not required.Checklist