Sha256: d600f6b345acdcc0eba21eb374143ad4914cd24613b482a28b09c3ddb8b09b8f
Contents?: true
Size: 643 Bytes
Versions: 14
Compression:
Stored size: 643 Bytes
Contents
module SCSSLint # Checks for quotes in URLs. class Linter::UrlQuotes < Linter include LinterRegistry def visit_prop(node) case node.value when Sass::Script::Tree::Literal check(node, node.value.value.to_s) when Sass::Script::Tree::ListLiteral node.value.children.select { |child| child.is_a?(Sass::Script::Tree::Literal) } .each { |child| check(node, child.value.to_s) } end yield end private def check(node, string) if string =~ /^\s*url\(\s*[^"']/ add_lint(node, 'URLs should be enclosed in quotes') end end end end
Version data entries
14 entries across 14 versions & 1 rubygems