Use optional jsonc on schema tags
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 234
- Forks
- 92
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
Shopify added support for comments and trailing commas for the theme files. Prettier have support for those using JSON5 JSONC parser and prettier can use that format on the *.json files (with some config), but the liquid plugin does not permit using that format on the json embedded on liquid files (on the schema tag).
As far as I could test, shopify accepts the prettier output for jsonc format, so it would make the prettier plugin output easier to review, so adding support there would match the principles.
That said, this feature cannot be implemented directly, because it would introduce an unexpected failure, as it would make code that was correct, now be incorrect. So we would need to add a setting (false by default until the next mayor version) to use jsonc format for the json embedded on the liquid files. With the setting, developers could choose when to migrate to JSONC format on the files.
Checklist
- I have checked and made sure that the proposal adheres to this plugin's principles
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Liquid plugin's schema-tag handling and how parser settings are applied to embedded JSON. Read docs/prettier-plugin-liquid/principles/index.md and docs/prettier-plugin-liquid/principles/easy-to-review.md for the constraints. Done means an opt-in, false-by-default setting supports JSONC for schema-tag content without changing existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100