Class: HamlLint::Linter::InlineStyles

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

Overview

Detects use of inline `style` attributes on any tag

Constant Summary collapse

MESSAGE =
'Do not use inline style attributes'

Instance Attribute Summary

Attributes inherited from HamlLint::Linter

#lints

Instance Method Summary collapse

Methods included from HamlLint::LinterRegistry

extract_linters_from, included

Methods inherited from HamlLint::Linter

#initialize, #name, #run

Methods included from HamlVisitor

#visit, #visit_children

Constructor Details

This class inherits a constructor from HamlLint::Linter

Instance Method Details

#visit_tag(node) ⇒ Object


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

def visit_tag(node)
  if node.has_hash_attribute?(:style)
    record_lint(node, MESSAGE)
  end
end