Sha256: ea8d86b580b62b1cddb3e9c768f3d9acded45b6419b7ef67f2f1441b73bfd013

Contents?: true

Size: 561 Bytes

Versions: 2

Compression:

Stored size: 561 Bytes

Contents

module SCSSLint
  # Checks that `@extend` is always used with a placeholder selector.
  class Linter::PlaceholderInExtend < Linter
    include LinterRegistry

    def visit_extend(node)
      # The array returned by the parser is a bit awkward in that it splits on
      # every word boundary (so %placeholder becomes ['%', 'placeholder']).
      selector = node.selector.join
      return if selector.start_with?('%')

      add_lint(node, 'Prefer using placeholder selectors (e.g. ' \
                     '%some-placeholder) with @extend')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scss-lint-0.24.1 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.24.0 lib/scss_lint/linter/placeholder_in_extend.rb