Sha256: 257b69f19f8cbc75bdf2e7600e4e1548ca15d8c108a0dad1e8bfc16403c874d3

Contents?: true

Size: 896 Bytes

Versions: 1

Compression:

Stored size: 896 Bytes

Contents

module SCSSLint
  class Linter::DeclaredName < Linter
    include LinterRegistry

    def visit_function(node)
      check(node)
      yield # Continue into content block of this function definition
    end

    def visit_mixindef(node)
      check(node)
      yield # Continue into content block of this mixin definition
    end

    def visit_rule(node)
      add_lint(node) if selector_has_bad_placeholder?(node.rule)
      yield # Continue linting into content block of this rule definition
    end

    def visit_variable(node)
      check(node)
      yield # Continue into expression tree for this variable definition
    end

    def description
      'Names of variables, functions, mixins, and placeholders should be ' <<
      'lowercase and use hyphens instead of underscores.'
    end

  private

    def check(node)
      add_lint(node) if node_has_bad_name?(node)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scss-lint-0.9.0 lib/scss_lint/linter/declared_name.rb