Sha256: d83da7e06ec83ece5b03348ade634002685f2940bd88778e2be1657ee7549561

Contents?: true

Size: 520 Bytes

Versions: 14

Compression:

Stored size: 520 Bytes

Contents

module SCSSLint
  # Reports when `border: 0` can be used instead of `border: none`.
  class Linter::BorderZero < Linter
    include LinterRegistry

    def visit_prop(node)
      return unless BORDER_PROPERTIES.include?(node.name.first.to_s)
      return unless node.value.to_sass.strip == 'none'

      add_lint(node, '`border: 0;` is preferred over `border: none;`')
    end

  private

    BORDER_PROPERTIES = %w[
      border
      border-top
      border-right
      border-bottom
      border-left
    ]
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
scss-lint-0.33.0 lib/scss_lint/linter/border_zero.rb
scss-lint-0.32.0 lib/scss_lint/linter/border_zero.rb
scss-lint-0.31.0 lib/scss_lint/linter/border_zero.rb
scss-lint-0.30.0 lib/scss_lint/linter/border_zero.rb
scss-lint-0.29.0 lib/scss_lint/linter/border_zero.rb
scss-lint-0.28.0 lib/scss_lint/linter/border_zero.rb
scss-lint-0.27.0 lib/scss_lint/linter/border_zero.rb
scss-lint-0.26.2 lib/scss_lint/linter/border_zero.rb
scss-lint-0.26.1 lib/scss_lint/linter/border_zero.rb
scss-lint-0.26.0 lib/scss_lint/linter/border_zero.rb
scss-lint-0.25.1 lib/scss_lint/linter/border_zero.rb
scss-lint-0.25.0 lib/scss_lint/linter/border_zero.rb
scss-lint-0.24.1 lib/scss_lint/linter/border_zero.rb
scss-lint-0.24.0 lib/scss_lint/linter/border_zero.rb