Class: SCSSLint::Linter::EmptyLineBetweenBlocks

Inherits:
SCSSLint::Linter
  • Object
show all
Includes:
SCSSLint::LinterRegistry
Defined in:
lib/scss_lint/linter/empty_line_between_blocks.rb

Overview

Reports the lack of empty lines between block defintions.

Constant Summary

Constants included from Utils

Utils::COLOR_REGEX

Instance Attribute Summary

Attributes inherited from SCSSLint::Linter

#config, #engine, #lints

Instance Method Summary collapse

Methods included from SCSSLint::LinterRegistry

extract_linters_from, included

Methods inherited from SCSSLint::Linter

#initialize, #name, #run

Methods included from Utils

#color?, #color_hex?, #color_keyword?, #color_keyword_to_code, #extract_string_selectors, #node_ancestor, #node_siblings, #pluralize, #previous_node, #remove_quoted_strings, #same_position?

Methods included from SelectorVisitor

#visit_selector

Constructor Details

This class inherits a constructor from SCSSLint::Linter

Instance Method Details

#visit_function(node) ⇒ Object



6
7
8
9
# File 'lib/scss_lint/linter/empty_line_between_blocks.rb', line 6

def visit_function(node)
  check(node, '@function')
  yield
end

#visit_mixin(node) ⇒ Object



11
12
13
14
15
16
# File 'lib/scss_lint/linter/empty_line_between_blocks.rb', line 11

def visit_mixin(node)
  # Ignore @includes which don't have any block content
  check(node, '@include') if node.children
                                 .any? { |child| child.is_a?(Sass::Tree::Node) }
  yield
end

#visit_mixindef(node) ⇒ Object



18
19
20
21
# File 'lib/scss_lint/linter/empty_line_between_blocks.rb', line 18

def visit_mixindef(node)
  check(node, '@mixin')
  yield
end

#visit_rule(node) ⇒ Object



23
24
25
26
# File 'lib/scss_lint/linter/empty_line_between_blocks.rb', line 23

def visit_rule(node)
  check(node, 'Rule')
  yield
end