lib/scss_lint/linter/vendor_prefixes.rb in scss-lint-0.33.0 vs lib/scss_lint/linter/vendor_prefixes.rb in scss-lint-0.34.0
- old
+ new
@@ -14,12 +14,12 @@
name = node.name.is_a?(Array) ? node.name.join : node.name
# Ignore '@' from @keyframes node name
check_identifier(node, name.gsub(/^@/, ''))
# Check for values
- return unless node.respond_to?(:value) && node.value.respond_to?(:to_sass)
- check_identifier(node, node.value.to_sass)
+ return unless node.respond_to?(:value) && node.value.respond_to?(:source_range)
+ check_identifier(node, source_from_range(node.value.source_range))
end
alias_method :visit_prop, :check_node
alias_method :visit_pseudo, :check_node
alias_method :visit_directive, :check_node
@@ -29,10 +29,10 @@
def check_identifier(node, identifier)
return unless identifier =~ /^[_-]/
# Strip vendor prefix to check against identifiers.
# (Also strip closing parentheticals from values like linear-gradient.)
- stripped_identifier = identifier.gsub(/(^[_-][a-zA-Z0-9_]+-|\(.*\))/, '')
+ stripped_identifier = identifier.gsub(/(^[_-][a-zA-Z0-9_]+-|\(.*\)|;)/, '').strip
return if @exclusions.include?(stripped_identifier)
return unless @identifiers.include?(stripped_identifier)
add_lint(node, 'Avoid vendor prefixes.')
end