diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-07-14 19:58:54 +0200 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-07-14 19:58:54 +0200 |
commit | 2f85645d453ea67fac349325ff062735e758ddac (patch) | |
tree | 224d4a37d0b010937c30fc6016ef2ab5f15ab460 /lib/haml_lint/inline_javascript.rb | |
parent | 0f393724e7de8d764577b6622ccf43964539cb2b (diff) | |
download | gitlab-ce-haml-inlinescript-linter.tar.gz |
Brought in HAML Linter changes from Winniehaml-inlinescript-linter
Diffstat (limited to 'lib/haml_lint/inline_javascript.rb')
-rw-r--r-- | lib/haml_lint/inline_javascript.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/haml_lint/inline_javascript.rb b/lib/haml_lint/inline_javascript.rb new file mode 100644 index 00000000000..eef95cd95ef --- /dev/null +++ b/lib/haml_lint/inline_javascript.rb @@ -0,0 +1,14 @@ +require 'haml_lint/haml_visitor' +require 'haml_lint/linter' +require 'haml_lint/linter_registry' + +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. If needed, you can add this file to the list of exceptions in .haml-lint.yml.') + end + end +end |