Theme Check rule to warn against using hard coded block id
We've updated the docs to warn against relying on hard coded block ids. In additional to that it'd still be very valuable to have a theme check rule to warn against this usage as people author liquid code. See this document for examples of this.
👋🏻 @bahar-p Moving this to theme-tools, where the current version of theme check lives. This ruby version is being archived
Bahar: Keep in mind though the pattern goes beyond just {% if block.id %} - It could be with case/when statement or {% unless % or even with assign {%- assign block_id = block.id -%} ... The comparison logic here that uses block_id ... The assign could get complicated to detect. Check with @charlespwd on that These are the ways that comes to my mind. Check with @datamatt too because he used these patterns to find the hard coded id usages for app blocks to see if there's any other way aside from ^^ that he might have checked for if unless case/when assign with var
Will ship with next release.