Sha256: 85754293813e0a68199b1651a2fa606e76d1f56229632bc0be361b2086302133
Contents?: true
Size: 899 Bytes
Versions: 2
Compression:
Stored size: 899 Bytes
Contents
require 'sass' module SCSSLint class Linter::PropertyFormatLinter < Linter include LinterRegistry def visit_prop(node) line = engine.lines[node.line - 1] if node.line add_lint(node) unless line =~ PROPERTY_RE end def description 'Property declarations should always be on one line of the form ' << '`name: value;` or `name: [value] {` ' << '(are you missing a trailing semi-colon?)' end private VALUE_RE = %r{(\S+\s)*\S+} # eg. "10px", "10px normal" PROPERTY_RE = %r{ ^\s*[^:]+(?<!\s):\s # property name, colon not preceded by a space, one space ( # followed by #{VALUE_RE}; # property and terminating semi-colon eg. a b c; | # or ((#{VALUE_RE}\s)?\{) # nested property, optional value, trailing curly ) }x end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
scss-lint-0.7.1 | lib/scss_lint/linter/property_format_linter.rb |
scss-lint-0.7.0 | lib/scss_lint/linter/property_format_linter.rb |