Skip to content

Fix 3 theme checks that produce false positives on Horizon theme#1168

Draft
graygilmore wants to merge 3 commits intomainfrom
gg-fix-checks
Draft

Fix 3 theme checks that produce false positives on Horizon theme#1168
graygilmore wants to merge 3 commits intomainfrom
gg-fix-checks

Conversation

@graygilmore
Copy link
Copy Markdown
Contributor

@graygilmore graygilmore commented Apr 2, 2026

Summary

Fixes 3 theme checks that produce false positives on valid Liquid patterns:

  • MatchingTranslations: Exclude customer_accounts.* translation paths (like the existing shopify.* exclusion) — these are platform-provided translations that themes don't control
  • ValidBlockTarget: Allow local blocks (type _name) in presets when no root-level blocks array exists — local blocks reference files in blocks/ and don't need explicit declaration
  • UnclosedHTMLElement: Cross-identifier balancing for sibling conditionals in the same grandparent — handles patterns where one condition opens a tag and a different condition closes it (e.g. forloop.first opens a wrapper div and forloop.last closes it)

Test plan

  • npx vitest run packages/theme-check-common/src/checks/matching-translations/index.spec.ts — 18 tests pass
  • npx vitest run packages/theme-check-common/src/checks/valid-block-target/index.spec.ts — 68 tests pass
  • npx vitest run packages/theme-check-common/src/checks/unclosed-html-element/index.spec.ts — 11 tests pass

🤖 Generated with Claude Code

These are platform-provided translations that themes don't control, matching the existing exclusion for shopify.* paths. Renamed isShopifyPath to isExternalPath to reflect the broader scope.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@graygilmore graygilmore changed the title Fix 5 theme checks that produce false positives on Horizon theme Fix 4 theme checks that produce false positives on Horizon theme Apr 2, 2026
@graygilmore graygilmore changed the title Fix 4 theme checks that produce false positives on Horizon theme Update theme checks for modern practices Apr 2, 2026
@graygilmore graygilmore changed the title Update theme checks for modern practices Fix 3 theme checks that produce false positives on Horizon theme Apr 2, 2026
graygilmore and others added 2 commits April 2, 2026 15:57
…Target

Local blocks (type names starting with _) reference files in the blocks/ directory and don't need explicit declaration in a section's root-level blocks array. Sections that define block hierarchies purely through presets are a valid pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ment

Add a cross-identifier balancing pass that matches unmatched opens from one conditional against unmatched closes from a sibling conditional within the same grandparent. This handles patterns where one condition opens a tag and a different condition closes it — e.g. forloop.first opens a wrapper div and forloop.last closes it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant