All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gems.scss_lint-0.40.1.lib.scss_lint.linter.comment.rb Maven / Gradle / Ivy

There is a newer version: 3.7.2
Show newest version
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 node.invisible? || allowed?(node)
    end

  private

    # @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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy