I have this linter rule, that verifies that for every variable there is a use of !default
:
module SCSSLint
# Reports the use of !default in properties.
class Linter::DefaultRule < Linter
include LinterRegistry
def visit_variable(node)
return if source_from_range(node.source_range).include?('!default')
add_lint(node, '!default should be used')
end
end
end
And I want it to only check global variables, and not variables inside a function
or a mixin
.
How can I make it ignore non-globally scoped variables?