ValidSettingsKey: does not validate section settings in template JSON files
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 234
- Forks
- 92
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
Summary
The existing ValidSettingsKey check validates settings keys inside {% schema %} presets and defaults within Liquid section files. However, it does not validate settings keys in template JSON files (e.g. templates/page.json), where sections are instantiated with their actual store settings.
This means a typo in a setting key in a template JSON goes completely undetected by Theme Check.
Steps to reproduce
- Create a section
sections/main-page.liquidwith a schema containing a setting with"id": "heading_tag" - In
templates/page.json, reference that section with a typo in the settings key:
{
"sections": {
"main-page": {
"type": "main-page",
"settings": {
"heading_tagg": "h1"
}
}
},
"order": ["main-page"]
}
- Run
shopify theme check
Expected behavior
Theme Check reports an error or warning similar to:
Setting 'heading_tagg' does not exist in 'sections/main-page.liquid'.
Actual behavior
No error or warning is reported. The invalid key is silently ignored. The setting has no effect at runtime — which is especially hard to debug during a section schema refactor or key rename.
Context
The existing ValidSettingsKey check operates on SourceCodeType.LiquidHtml and validates settings in the presets and default blocks of a section's own {% schema %}. It does not cover section instances in template JSON files.
A complementary check (or an extension of ValidSettingsKey) would need to:
- Target
SourceCodeType.JSONtemplate files - For each section instance, resolve the corresponding
.liquidfile - Parse its
{% schema %}and collect valid setting IDs - Report any key in
settingsthat does not match a valid setting ID
Why this matters
This gap becomes critical in multi-store theme workflows where template JSON files are store-specific and diverge from the main code branch. A renamed setting key in Liquid will silently stop working on any store whose template JSON still references the old key — with no tooling to catch it.
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 reading the existing ValidSettingsKey check and how Theme Check handles SourceCodeType.JSON. Trace template JSON section instances to the corresponding Liquid section schema, then verify the existing shopify theme check reproduction reports unknown settings keys. Done means invalid keys such as heading_tagg are reported while valid settings remain accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100