Method: HamlLint::Linter::UnnecessaryStringOutput#visit_script
- Defined in:
- lib/haml_lint/linter/unnecessary_string_output.rb
#visit_script(node) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/haml_lint/linter/unnecessary_string_output.rb', line 22 def visit_script(node) # Some script nodes created by the HAML parser aren't actually script # nodes declared via the `=` marker. Check for it. return unless /\A\s*=/.match?(node.source_code) if outputs_string_literal?(node) record_lint(node, MESSAGE) end end |