Commit 2b781c78 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'winh-scope-haml-linter' into 'master'

Restrict InlineJavaScript for haml_lint to dev and test environment

Closes omnibus-gitlab#2658

See merge request !13364
parents 356c8b38 b3537000
require 'haml_lint/haml_visitor'
require 'haml_lint/linter'
require 'haml_lint/linter_registry'
unless Rails.env.production?
require 'haml_lint/haml_visitor'
require 'haml_lint/linter'
require 'haml_lint/linter_registry'
module HamlLint
class Linter::InlineJavaScript < Linter
include LinterRegistry
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 (https://docs.gitlab.com/ee/development/gotchas.html#do-not-use-inline-javascript-in-views)')
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
end
end
end
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