Class: SCSSLint::Linter::TrailingSemicolon
Overview
Checks for a trailing semicolon on statements within rule sets.
Constant Summary
Constants included
from Utils
Utils::COLOR_REGEX
Instance Attribute Summary
#config, #engine, #lints
Instance Method Summary
collapse
extract_linters_from, included
#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?
#visit_selector
Instance Method Details
#visit_extend(node) ⇒ Object
6
7
8
|
# File 'lib/scss_lint/linter/trailing_semicolon.rb', line 6
def visit_extend(node)
check_semicolon(node)
end
|
#visit_import(node) ⇒ Object
30
31
32
33
34
|
# File 'lib/scss_lint/linter/trailing_semicolon.rb', line 30
def visit_import(node)
return if source_from_range(node.source_range) =~ /,\s*$/
check_semicolon(node)
end
|
#visit_mixin(node) ⇒ Object
22
23
24
25
26
27
28
|
# File 'lib/scss_lint/linter/trailing_semicolon.rb', line 22
def visit_mixin(node)
if node.children.any?
yield else
check_semicolon(node)
end
end
|
#visit_prop(node) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/scss_lint/linter/trailing_semicolon.rb', line 14
def visit_prop(node)
if node.children.any? { |n| n.is_a?(Sass::Tree::PropNode) }
yield else
check_semicolon(node)
end
end
|
#visit_variable(node) ⇒ Object
10
11
12
|
# File 'lib/scss_lint/linter/trailing_semicolon.rb', line 10
def visit_variable(node)
check_semicolon(node)
end
|