lib/theme_check/checks/unused_assign.rb in theme-check-1.7.2 vs lib/theme_check/checks/unused_assign.rb in theme-check-1.8.0

- old
+ new

@@ -44,11 +44,12 @@ def on_end @templates.each_pair do |_, info| used = info.collect_used_assigns(@templates) info.assign_nodes.each_pair do |name, node| - unless used.include?(name) - add_offense("`#{name}` is never used", node: node) + next if used.include?(name) + add_offense("`#{name}` is never used", node: node) do |corrector| + corrector.remove(node) end end end end end