lib/scss_lint/linter/trailing_semicolon.rb in scss-lint-0.29.0 vs lib/scss_lint/linter/trailing_semicolon.rb in scss-lint-0.30.0
- old
+ new
@@ -25,10 +25,14 @@
else
check_semicolon(node)
end
end
+ def visit_import(node)
+ check_semicolon(node)
+ end
+
private
def check_semicolon(node)
if has_space_before_semicolon?(node)
line = node.source_range.start_pos.line
@@ -44,18 +48,18 @@
end
end
# Checks that the node is ended by a semicolon (with no whitespace)
def ends_with_semicolon?(node)
- source_from_range(node.source_range) =~ /;$/
+ source_from_range(node.source_range) =~ /;(\s*})?$/
end
def ends_with_multiple_semicolons?(node)
# Look one character past the end to see if there's another semicolon
character_at(node.source_range.end_pos, 1) == ';'
end
def has_space_before_semicolon?(node)
- source_from_range(node.source_range) =~ /\s;$/
+ source_from_range(node.source_range) =~ /\s;(\s*})?$/
end
end
end