Class: HamlLint::Linter::EmptyScript

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

Overview

Checks for empty scripts.

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, #run_or_raise, supports_autocorrect?, #supports_autocorrect?

Methods included from HamlVisitor

#visit, #visit_children

Constructor Details

This class inherits a constructor from HamlLint::Linter

Instance Method Details

#visit_silent_script(node) ⇒ Object



8
9
10
11
12
# File 'lib/haml_lint/linter/empty_script.rb', line 8

def visit_silent_script(node)
  return unless /\A\s*\Z/.match?(node.script)

  record_lint(node, 'Empty script should be removed')
end