Sha256: a13c76cf609521c46da9d8182e9b48f90edad129b2268095511be74622857ace

Contents?: true

Size: 558 Bytes

Versions: 17

Compression:

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

      add_lint(node) unless selector.start_with?('%')
    end

    def description
      'Always use placeholder selectors (e.g. %some-placeholder) with @extend'
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
scss-lint-0.20.3 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.20.2 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.20.1 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.20.0 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.19.0 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.18.0 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.17.3 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.17.2 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.17.1 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.17.0 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.16.1 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.16.0 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.15.0 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.14.0 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.13.0 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.12.1 lib/scss_lint/linter/placeholder_in_extend.rb
scss-lint-0.12.0 lib/scss_lint/linter/placeholder_in_extend.rb