Skip to content

Add JSONMissingSection check - #1286

Merged
lukeh-shopify merged 1 commit into
mainfrom
lh-json-missing-section-check
Aug 26, 2026
Merged

Add JSONMissingSection check#1286
lukeh-shopify merged 1 commit into
mainfrom
lh-json-missing-section-check

Conversation

@lukeh-shopify

@lukeh-shopify lukeh-shopify commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What are you trying to accomplish?

Theme Check already validates block and section references (in liquid files), but nothing validates the section type references inside json files. A theme can pass theme check locally while referencing a section file that doesn't exist, and then fail server-side validation on upload/publish.

This adds a JSONMissingSection check so that error surfaces at lint time instead

What approach did you use?

  • Modeled on JSONMissingBlock
  • For every entry in the sections map of a json template or section group that has a string type, report an offense on the type node when sections/<type>.liquid doesn't exist.
  • Skips apps and _blocks and entries without a type.

📸

image

@lukeh-shopify
lukeh-shopify requested a review from a team as a code owner August 26, 2026 18:20
@lukeh-shopify
lukeh-shopify marked this pull request as draft August 26, 2026 21:30
@lukeh-shopify
lukeh-shopify marked this pull request as ready for review August 26, 2026 21:55

@graygilmore graygilmore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 🎩

Image

Comment thread packages/theme-check-common/src/checks/json-missing-section/index.ts Outdated
@lukeh-shopify
lukeh-shopify force-pushed the lh-json-missing-section-check branch from ffc7433 to 54c5cc8 Compare August 26, 2026 23:28
@lukeh-shopify
lukeh-shopify merged commit a07f908 into main Aug 26, 2026
8 checks passed
@lukeh-shopify
lukeh-shopify deleted the lh-json-missing-section-check branch August 26, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants