Shopify / Shopify/theme-tools

Use optional jsonc on schema tags

Open
#815 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.