Sha256: 1e30c275dba2cfa1584341416413a746f989d0eaa036560ba40ffdc3bf5c1e25

Contents?: true

Size: 372 Bytes

Versions: 5

Compression:

Stored size: 372 Bytes

Contents

require 'sass'

module SCSSLint
  class Linter::ZeroUnitLinter < Linter
    include LinterRegistry

    def visit_prop(node)
      line = engine.lines[node.line - 1] if node.line
      add_lint(node) if line =~ /^\s*[\w-]+:\s*0[a-z]+;$/i
    end

    def description
      'Properties with a value of zero should be unit-less, e.g. "0" instead of "0px"'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
scss-lint-0.7.1 lib/scss_lint/linter/zero_unit_linter.rb
scss-lint-0.7.0 lib/scss_lint/linter/zero_unit_linter.rb
scss-lint-0.6.7 lib/scss_lint/linter/zero_unit_linter.rb
scss-lint-0.6.6 lib/scss_lint/linter/zero_unit_linter.rb
scss-lint-0.6.5 lib/scss_lint/linter/zero_unit_linter.rb