You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Justification: dotnet itself allows comments in global.json, so when I wanted to setup this action for an existing project it failed without modifying global.json. As an alternative, I had to use with: dotnet-version, which goes against the 'single source of truth' principle.
This is not to start a flame war; I am well aware that the standard JSON does not allow comments. And for data-interchange I agree. But for configuration it is actually quite handy. JSON5 allows it, and so does tsconfig.json (this very project is TypeScript).
Are you willing to submit a PR?
Sure.
The text was updated successfully, but these errors were encountered:
@xt0rted
I am a bit reluctant to simply replace the entire JSON library. It should work, but JSON5 does a lot more than just allow comments.
Instead, I implemented #257, which is really a one-liner doing exactly as the proposal requested: remove comments before parsing global.json. Nothing more than that.
Description:
Strip c-style comments from
global.json
before parsing.I recommend https://www.npmjs.com/package/strip-json-comments, which helps keeping positional error reporting accurate.
Justification:
dotnet
itself allows comments inglobal.json
, so when I wanted to setup this action for an existing project it failed without modifying global.json. As an alternative, I had to usewith: dotnet-version
, which goes against the 'single source of truth' principle.This is not to start a flame war; I am well aware that the standard JSON does not allow comments. And for data-interchange I agree. But for configuration it is actually quite handy. JSON5 allows it, and so does
tsconfig.json
(this very project is TypeScript).Are you willing to submit a PR?
Sure.
The text was updated successfully, but these errors were encountered: