Skip to content

Use of full JSONC Parser #267

@Cielquan

Description

@Cielquan

I use a JSONC file over JSON for my markdownlint-cli2 config to add comments.

In prettier via prettier/prettier#15553 a new jsonc parser was added, which is released but I think only in the 4.0 alpha. With this new parser prettier adds trailing commas to jsonc source. When I ran my QA toolchain, after updating the tools, markdownlint suddenly was throwing. The reason was, that the jsonc config (with trailing commas) could not be correctly parsed. I looked up the stacktrace and found the internal jsonc parser, which is at base just JSON.parse() which in turn does not allow trailing commas hence the issue. Based on this prettier/prettier#15553 (comment) it would propably be a good to utilize a fully fledged jsonc parser like https://github.com/microsoft/node-jsonc-parser?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed in nextFixed in the "next" branch for the next release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions