Sha256: ab64030cda2662374f8796668555942c6c3ce26fde10b407b185988b2159e866
Contents?: true
Size: 808 Bytes
Versions: 19
Compression:
Stored size: 808 Bytes
Contents
module SCSSLint # Checks for spaces following the name of a property and before the colon # separating the property's name from its value. class Linter::SpaceAfterPropertyName < Linter include LinterRegistry def visit_prop(node) offset = property_name_colon_offset(node) return unless character_at(node.name_source_range.start_pos, offset - 1) == ' ' add_lint node, 'Property name should be immediately followed by a colon' end private # Deals with a weird Sass bug where the name_source_range of a PropNode does # not start at the beginning of the property name. def property_name_colon_offset(node) offset = 0 while character_at(node.name_source_range.start_pos, offset) != ':' offset += 1 end offset end end end
Version data entries
19 entries across 19 versions & 3 rubygems