diff --git a/README.md b/README.md
index 95df43a2..a1ec2806 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ You can disable a rule by placing a disable comment in the following format:
Comment on offending lines
```.erb
-
<%# erblint:disable SelfClosingTag %>
+
<%# erb_lint:disable SelfClosingTag %>
```
To raise an error when there is a useless disable comment, enable `NoUnusedDisable`.
diff --git a/lib/erb_lint/utils/inline_configs.rb b/lib/erb_lint/utils/inline_configs.rb
index c90eb54a..031cde70 100644
--- a/lib/erb_lint/utils/inline_configs.rb
+++ b/lib/erb_lint/utils/inline_configs.rb
@@ -4,11 +4,11 @@ module ERBLint
module Utils
class InlineConfigs
def self.rule_disable_comment_for_lines?(rule, lines)
- lines.match?(/# erblint:disable (?.*#{rule}).*/)
+ lines.match?(/# erb_?lint:disable (?.*#{rule}).*/)
end
def self.disabled_rules(line)
- line.match(/# erblint:disable (?.*) %>/)&.named_captures&.fetch("rules")
+ line.match(/# erb_?lint:disable (?.*) %>/)&.named_captures&.fetch("rules")
end
end
end
diff --git a/spec/lib/erb_lint/utils/inline_configs_spec.rb b/spec/lib/erb_lint/utils/inline_configs_spec.rb
index d13adb65..90d839a7 100644
--- a/spec/lib/erb_lint/utils/inline_configs_spec.rb
+++ b/spec/lib/erb_lint/utils/inline_configs_spec.rb
@@ -11,6 +11,11 @@
expect(utils.rule_disable_comment_for_lines?("AnchorRule", offending_lines)).to(be(true))
end
+ it "supports both erb_lint and erblint naming" do
+ offending_lines = '<%# erb_lint:disable AnchorRule %>'
+ expect(utils.rule_disable_comment_for_lines?("AnchorRule", offending_lines)).to(be(true))
+ end
+
it "true lines when lines contain a erblint:disable comment for rule in Ruby comment" do
offending_lines = '<%
button = {