summaryrefslogtreecommitdiff
path: root/unwrapped_plain_node.rb
diff options
context:
space:
mode:
Diffstat (limited to 'unwrapped_plain_node.rb')
-rw-r--r--unwrapped_plain_node.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/unwrapped_plain_node.rb b/unwrapped_plain_node.rb
new file mode 100644
index 00000000000..9525e830304
--- /dev/null
+++ b/unwrapped_plain_node.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+module HamlLint
+ # Checks for unwrapped text nodes.
+ # Useful for i18n helper methods.
+ #
+ # Fail: %tag Some text
+ # Pass: %tag= _('Some text')
+ class Linter::UnwrappedPlainNode < Linter
+ include LinterRegistry
+
+ MESSAGE = '`= "..."` should be rewritten as `...`'.freeze
+
+ def visit_plain(node)
+ record_lint(node, MESSAGE)
+ end
+ end
+end