Open Eonfge opened 4 years ago
Definitely would be nice to have, I always use JSON parsers that accept comments in my projects.
The scripts are quite easy to generate, for example here is a "format jsonc" script that you can drop into Boop-GTK's scripts folder. This was generated with the following:
const jsonc = require('jsonc-parser');
global.main = function (state) {
let edits = jsonc.format(state.text, undefined, { tabSize: 4, insertSpaces: true, eol: "\n" });
state.text = jsonc.applyEdits(state.text, edits);
}
Then following the instructions here.
As far as including it in the default set of scripts, right now all the scripts come from the project this was based of, Boop. I am not sure what the best policy for script requests should be, but perhaps its best to open an issue in the Boop repo, then both projects can benefit.
I've reported it upstream. You want to keep this issue open or is this good enough for now?
May as well keep it open.
https://komkom.github.io/
Right now, parsing json files with comments, causes it to fail. This is annoying since comments are an all-round good practice and they are often de facto required when working in teams.