Sha256: 9acb4e108b8804d12721b238d583161315295ae99ebef2dd492eb462269f680f

Contents?: true

Size: 503 Bytes

Versions: 4

Compression:

Stored size: 503 Bytes

Contents

module SCSSLint
  # Checks for spaces following the name of a variable and before the colon
  # separating the variables's name from its value.
  class Linter::SpaceAfterVariableName < Linter
    include LinterRegistry

    def visit_variable(node)
      return unless spaces_before_colon?(node)
      add_lint(node, 'Variable names should be followed immediately by a colon')
    end

  private

    def spaces_before_colon?(node)
      source_from_range(node.source_range) =~ /\s+:/
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
scss_lint-0.42.2 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.42.1 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.42.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.41.0 lib/scss_lint/linter/space_after_variable_name.rb