Skip to content

Fix local block validation in presets and defaults - #1285

Open
OllieinCanada wants to merge 1 commit into
Shopify:mainfrom
OllieinCanada:fix/section-block-presets-965
Open

Fix local block validation in presets and defaults#1285
OllieinCanada wants to merge 1 commit into
Shopify:mainfrom
OllieinCanada:fix/section-block-presets-965

Conversation

@OllieinCanada

Copy link
Copy Markdown

Fixes #965

What changed

  • validate section-local block types referenced by presets
  • validate section-local block types referenced by default.blocks
  • preserve valid references to locally declared blocks

Root cause

ValidBlockTarget returned as soon as it found a local block declaration, so preset and default references were never checked. In addition, ordinary default block entries were omitted from the collected default-level blocks unless they happened to have a name property.

The check now compares top-level preset and default block types with the section's local declarations before returning. Theme-block validation remains on its existing path.

Tests

  • focused ValidBlockTarget suite: 73 passed
  • full theme-check-common source suite: 4,855 passed
  • tsc -b packages/theme-check-common/tsconfig.build.json
  • tsc -p packages/theme-check-common/tsconfig.json --noEmit
  • pnpm format:check
  • git diff --check

Signed-off-by: Oliver Slapinski <olliefromcanada@gmail.com>
@OllieinCanada
OllieinCanada requested a review from a team as a code owner August 25, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Section blocks are not validated in presets or default

1 participant