Verified Commit 25283e71 authored by Connor Shea's avatar Connor Shea 🏄

Update inline_javascript.rb to lint uses of the javascript filter as well as script tags.

parent 83b3e9fa
......@@ -6,7 +6,13 @@ unless Rails.env.production?
module HamlLint
class Linter::InlineJavaScript < Linter
include LinterRegistry
def visit_filter(node)
return unless node.filter_type == 'javascript'
record_lint(node, 'Inline JavaScript is discouraged (')
def visit_tag(node)
return unless node.tag_name == 'script'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment