lib/scss_lint/linter/duplicate_property.rb in scss-lint-0.14.0 vs lib/scss_lint/linter/duplicate_property.rb in scss-lint-0.15.0
- old
+ new
@@ -11,13 +11,28 @@
prop_names = {}
properties.each do |prop|
name = prop.name.join
- if existing_prop = prop_names[name]
+ prop_hash = name
+ prop_value =
+ case prop.value
+ when Sass::Script::Funcall
+ prop.value.name
+ when Sass::Script::String
+ prop.value.value
+ else
+ prop.value.to_s
+ end
+
+ prop_value.to_s.scan(/^(-[^-]+-.+)/) do |vendor_keyword|
+ prop_hash << vendor_keyword.first
+ end
+
+ if existing_prop = prop_names[prop_hash]
add_lint(prop, "Property '#{name}' already defined on line #{existing_prop.line}")
else
- prop_names[name] = prop
+ prop_names[prop_hash] = prop
end
end
end
end
end