lib/scss_lint/linter/comment.rb in scss_lint-0.50.2 vs lib/scss_lint/linter/comment.rb in scss_lint-0.50.3

- old
+ new

@@ -2,11 +2,11 @@ # Checks for uses of renderable comments (/* ... */) class Linter::Comment < Linter include LinterRegistry def visit_comment(node) - add_lint(node, 'Use `//` comments everywhere') unless valid_comment?(node) + add_lint(node, message) unless valid_comment?(node) end private def valid_comment?(node) @@ -28,8 +28,16 @@ def allowed?(node) return false unless config['allowed'] re = Regexp.new(config['allowed']) node.value.join.match(re) + end + + def message + if config.fetch('style', 'silent') == 'silent' + 'Use `//` comments everywhere' + else + 'Use `/* */` comments everywhere' + end end end end