Class: HamlLint::Linter::EmptyObjectReference
- Inherits:
-
HamlLint::Linter
- Object
- HamlLint::Linter
- HamlLint::Linter::EmptyObjectReference
- Includes:
- HamlLint::LinterRegistry
- Defined in:
- lib/haml_lint/linter/empty_object_reference.rb
Overview
Checks for empty object references (e.g. ‘%div[]`).
Instance Attribute Summary
Attributes inherited from HamlLint::Linter
Instance Method Summary collapse
Methods included from HamlLint::LinterRegistry
extract_linters_from, included
Methods inherited from HamlLint::Linter
#initialize, #name, #run, #run_or_raise, supports_autocorrect?, #supports_autocorrect?
Methods included from HamlVisitor
Constructor Details
This class inherits a constructor from HamlLint::Linter
Instance Method Details
#visit_tag(node) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/haml_lint/linter/empty_object_reference.rb', line 8 def visit_tag(node) return unless node.object_reference? && node.object_reference_source.strip.empty? record_lint(node, 'Empty object reference should be removed') end |