Sha256: 5e79f434f7b3539a1f3b88aa9468c6905d4eeb9ef11a2d2460a4cc39734af6ff
Contents?: true
Size: 545 Bytes
Versions: 10
Compression:
Stored size: 545 Bytes
Contents
# frozen_string_literal: true module ThemeCheck # # Unwanted: # # {{ x | some_unknown_filter }} # # Wanted: # # {{ x | upcase }} # class UnknownFilter < LiquidCheck severity :error category :liquid def on_variable(node) used_filters = node.value.filters.map { |name, *_rest| name } undefined_filters = used_filters - ShopifyLiquid::Filter.labels undefined_filters.each do |undefined_filter| add_offense("Undefined filter `#{undefined_filter}`", node: node) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems