lib/scss_lint/linter/trailing_semicolon.rb in scss-lint-0.26.1 vs lib/scss_lint/linter/trailing_semicolon.rb in scss-lint-0.26.2
- old
+ new
@@ -9,27 +9,26 @@
def visit_variable(node)
check_semicolon(node)
end
- def visit_possible_parent(node)
- if has_nested_properties?(node)
+ def visit_prop(node)
+ if node.children.any? { |n| n.is_a?(Sass::Tree::PropNode) }
yield # Continue checking children
else
check_semicolon(node)
end
end
- alias_method :visit_mixin, :visit_possible_parent
- alias_method :visit_prop, :visit_possible_parent
-
- private
-
- def has_nested_properties?(node)
- node.children.any? do |n|
- n.is_a?(Sass::Tree::PropNode) || n.is_a?(Sass::Tree::RuleNode)
+ def visit_mixin(node)
+ if node.children.any?
+ yield # Continue checking children
+ else
+ check_semicolon(node)
end
end
+
+ private
def check_semicolon(node)
if has_space_before_semicolon?(node)
line = node.source_range.start_pos.line
add_lint line, 'Declaration should be terminated by a semicolon'