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
...@@ -7,6 +7,12 @@ unless Rails.env.production? ...@@ -7,6 +7,12 @@ unless Rails.env.production?
class Linter::InlineJavaScript < Linter class Linter::InlineJavaScript < Linter
include LinterRegistry include LinterRegistry
def visit_filter(node)
return unless node.filter_type == 'javascript'
record_lint(node, 'Inline JavaScript is discouraged (https://docs.gitlab.com/ee/development/gotchas.html#do-not-use-inline-javascript-in-views)')
end
def visit_tag(node) def visit_tag(node)
return unless node.tag_name == 'script' 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