Sha256: dbb7d4443b6e7757fa71ec952d3d106a6f4bf6eb67017f20b793e9f3eec32ade

Contents?: true

Size: 510 Bytes

Versions: 25

Compression:

Stored size: 510 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) =~ /\A[^:]+\s+:/
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
scss_lint-0.60.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.59.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.58.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.57.1 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.57.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.56.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.55.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.54.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.53.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.52.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.51.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.50.3 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.50.2 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.50.1 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.50.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.49.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.48.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.47.1 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.47.0 lib/scss_lint/linter/space_after_variable_name.rb
scss_lint-0.46.0 lib/scss_lint/linter/space_after_variable_name.rb