Skip to content

Fix several Theme Check paper cuts - #1301

Merged
karreiro merged 6 commits into
mainfrom
theme-check-cleanup-selected
Sep 21, 2026
Merged

karreiro merged 6 commits into
mainfrom
theme-check-cleanup-selected

Conversation

@karreiro

@karreiro karreiro commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What are you adding in this PR?

This PR fixes several small gaps across Theme Check:

  • Fix responsive LCP preload validation by allowing explicit image links with fetchpriority="high"
  • Fix LiquidDoc parameter validation by reserving Liquid literal keywords
  • Fix schema expressions to resolve assigned Liquid variables and recognize their usage
  • Fix Liquid variable-name validation to allow a leading underscore
  • Fix orphaned-snippet detection by following layout and {% block %} references

Each fix includes regression coverage and its own patch changeset.

Before you deploy

  • This PR includes patch changesets for each bug fix.

These are meaningful because Liquid always parses them as literals. For example, an @PARAM true value could be passed but never referenced as a variable—{{ true }} is always Boolean true.
Allow ValidVisibleIf to resolve variables assigned by the Liquid file, and count references from valid visible_if expressions when checking for unused assignments.
JSON templates already connect to their implicit layout, so snippets rendered by that layout are included in the graph. Liquid templates did not establish the same connection, leaving valid layout-rendered snippets incorrectly reported as orphaned.

Treat layouts as graph entry points and follow {% block %} dependencies so direct and transitive snippet references are discovered consistently.
@karreiro
karreiro requested a review from a team as a code owner September 15, 2026 08:58

@aswamy aswamy 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.

Couple of tweaks recommended but overall good approach

Comment thread packages/theme-check-common/src/checks/valid-visible-if/index.ts
Comment thread packages/theme-check-common/src/checks/asset-preload/index.ts Outdated
@karreiro
karreiro merged commit 8bc5e03 into main Sep 21, 2026
8 checks passed
@karreiro
karreiro deleted the theme-check-cleanup-selected branch September 21, 2026 10:07
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