Sha256: 35e014043520924df284d39cdc4297a504e3510ab95398af15cb1a920aad145a

Contents?: true

Size: 681 Bytes

Versions: 18

Compression:

Stored size: 681 Bytes

Contents

module SCSSLint
  # Checks for uses of properties where a Compass mixin would be preferred.
  class Linter::Compass::PropertyWithMixin < Linter::Compass
    include LinterRegistry

    def visit_prop(node)
      prop_name = node.name.join

      if PROPERTIES_WITH_MIXINS.include?(prop_name)
        add_lint node, "Use the Compass `#{prop_name}` mixin instead of the property"
      end
    end

  private

    # Set of properties where the Compass mixin version is preferred
    PROPERTIES_WITH_MIXINS = %w[
      background-clip
      background-origin
      border-radius
      box-shadow
      box-sizing
      opacity
      text-shadow
      transform
    ].to_set
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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