Shopify / theme-tools

Everything developer experience for Shopify themes
https://shopify.dev/docs/themes
MIT License
80 stars 24 forks source link

Add ValidLocalBlocks Check #587

Closed navdeep5 closed 1 week ago

navdeep5 commented 1 week ago

What are you adding in this PR?

Resolves https://github.com/Shopify/theme-tools/issues/552

This PR introduces enhanced validation checks for local and static blocks, combining the following functionalities:

  1. Validate that theme blocks do not utilize locally scoped blocks. image

  2. Ensure that sections using local blocks will not use theme blocks. image

  3. Ensure that sections using local blocks will not use theme blocks. image

  4. Validate that static blocks do not have a "name" property. image

What's next? Any followup issues?

With this being a new check, we will want to update https://github.com/Shopify/shopify-dev so users can understand their errors. Developer Docs changes: https://github.com/Shopify/shopify-dev/pull/50568

What did you learn?

While writing this check, I learned about static blocks -- how they are represented in liquid and their associated do's and don'ts.

Before you deploy