class SCSSLint::Linter::SpaceAfterVariableName

Checks for spaces following the name of a variable and before the colon separating the variables's name from its value.

Public Instance Methods

visit_variable(node) click to toggle source
# File lib/scss_lint/linter/space_after_variable_name.rb, line 7
def visit_variable(node)
  return unless spaces_before_colon?(node)
  add_lint(node, 'Variable names should be followed immediately by a colon')
end

Private Instance Methods

spaces_before_colon?(node) click to toggle source
# File lib/scss_lint/linter/space_after_variable_name.rb, line 14
def spaces_before_colon?(node)
  source_from_range(node.source_range) =~ /\A[^:]+\s+:/
end