This might be more effort than it's worth, but I've been contemplating the possibility of writing a native JSON parser for use in libphutil. JSON isn't a difficult language to parse AFAICT (see jsonlint.y and jsonlint.l). There are a couple of reasons that I think that this could be useful:
- The ability to lint JSON files without any external dependencies (currently, we have an ArcanistJSONLintLinter to lint JSON files, but this requires jsonlint to be installed from npm).
- We could, theoretically, add a mode to the JSON parser to allow // ... and/or /* ... */ style comments.
- As mentioned in T5260, the .arclint file format doesn't currently allow comments.
- Some JSON-like file formats (Sublime Text configuration files are one example, and I am sure that there are others) do allow comments. It's not currently possible to lint these files properly with ArcanistJSONLintLinter.
@epriestley, what are your thoughts?