Sha256: 6d0427d631f0bb78ceee99a6618c455ce04dd60d6a6044934c72d88854eafcc3

Contents?: true

Size: 489 Bytes

Versions: 10

Compression:

Stored size: 489 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 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

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
scss_lint-0.42.2 lib/scss_lint/linter/comment.rb
scss_lint-0.42.1 lib/scss_lint/linter/comment.rb
scss_lint-0.42.0 lib/scss_lint/linter/comment.rb
scss_lint-0.41.0 lib/scss_lint/linter/comment.rb
scss_lint-0.40.1 lib/scss_lint/linter/comment.rb
scss_lint-0.40.0 lib/scss_lint/linter/comment.rb
scss_lint-0.39.0 lib/scss_lint/linter/comment.rb
scss_lint-0.38.0 lib/scss_lint/linter/comment.rb
scss-lint-0.38.0 lib/scss_lint/linter/comment.rb
scss-lint-bliss-1.0.0 lib/scss_lint/linter/comment.rb