Sha256: b69ec181ead8f8e2ca5335509ebd0070d7ef66a27ef26d42bb463b4f0b95afe9
Contents?: true
Size: 531 Bytes
Versions: 12
Compression:
Stored size: 531 Bytes
Contents
module SCSSLint # Checks for unnecessary units on zero values. class Linter::ZeroUnit < Linter include LinterRegistry def visit_script_string(node) node.value.scan(/\b(0[a-z]+)\b/i) do |match| add_lint(node, MESSAGE_FORMAT % match.first) end end def visit_script_number(node) if node.value == 0 && !node.unitless? add_lint(node, MESSAGE_FORMAT % node.original_string) end end private MESSAGE_FORMAT = '`%s` should be written without units as `0`' end end
Version data entries
12 entries across 12 versions & 1 rubygems