Sha256: 3105542e1bea197756af6011d29b0db97501efd999ff598912dc013d5bf1239e
Contents?: true
Size: 845 Bytes
Versions: 13
Compression:
Stored size: 845 Bytes
Contents
module SCSSLint # 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) end private def valid_comment?(node) allowed_type = if config.fetch('style', 'silent') == 'silent' node.invisible? else !node.invisible? end return true if allowed_type # Otherwise check if comment contains content that excludes it (i.e. a # copyright notice for loud comments) allowed?(node) end # @param node [CommentNode] # @return [Boolean] def allowed?(node) return false unless config['allowed'] re = Regexp.new(config['allowed']) node.value.join.match(re) end end end
Version data entries
13 entries across 13 versions & 1 rubygems