Error reported by Theme Check when opening synced JSON template files due to injected comments from the theme editor

Short description of issue

Synced json template files include an injected comment that VSCode/Theme Check complains is not valid JSON.

Reproduction steps

Sync a JSON template file through the CLI’s shopify theme pull command that includes JSON template files that were modified in the theme editor. The file will include the following comment, which is reported as an error caused by invalid JSON:

/*
 * ------------------------------------------------------------
 * IMPORTANT: The contents of this file are auto-generated.
 *
 * This file may be updated by the Shopify admin theme editor
 * or related systems. Please exercise caution as any changes
 * made to this file may be overwritten.
 * ------------------------------------------------------------
 */

Additional info

Not valid JSON but acceptable in Shopify template files.

What type of topic is this

Troubleshooting
Bug report

Upload screenshot(s) of issue

I don’t believe the error you’re seeing is being reported by Theme Check but rather your editor. You’ll want to make sure your editor has support for JSONC (JSON with Comments).

It looks like you’re using VS Code so I’d recommend using the Shopify Liquid extension which I think includes JSONC support: theme-tools/packages/vscode-extension at main · Shopify/theme-tools · GitHub