Sha256: 58952de5b2ce123644fa7207c17d4921a65b625d5afc3ed912dd3ddd09c0c829
Contents?: true
Size: 602 Bytes
Versions: 10
Compression:
Stored size: 602 Bytes
Contents
# frozen_string_literal: true module ThemeCheck # Reports errors when trying to use parser-blocking script tags class ParserBlockingScriptTag < LiquidCheck severity :error categories :liquid, :performance doc docs_url(__FILE__) def on_variable(node) used_filters = node.filters.map { |name, *_rest| name } if used_filters.include?("script_tag") add_offense( "The script_tag filter is parser-blocking. Use a script tag with the async or defer " \ "attribute for better performance", node: node ) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems