Class: HamlLint::Linter::HtmlAttributes

Inherits:
Linter
  • Object
show all
Includes:
HamlLint::LinterRegistry
Defined in:
lib/haml_lint/linter/html_attributes.rb

Overview

Checks for the setting of attributes via HTML shorthand syntax on elements (e.g. %tag(lang=en)).

Instance Method Summary collapse

Methods included from HamlLint::LinterRegistry

extract_linters_from, included

Instance Method Details

#visit_tag(node) ⇒ Object



9
10
11
12
13
14
# File 'lib/haml_lint/linter/html_attributes.rb', line 9

def visit_tag(node)
  return unless node.html_attributes?

  record_lint(node, "Prefer the hash attributes syntax (%tag{ lang: 'en' }) " \
                    'over HTML attributes syntax (%tag(lang=en))')
end