Sha256: 08fbb9e540f43c609c25055b8076b7f23dcf41a84ed97c889a88b6c95fa84b43
Contents?: true
Size: 673 Bytes
Versions: 2
Compression:
Stored size: 673 Bytes
Contents
module SCSSLint # Checks for a selector with an ID combined with some other selector. class Linter::IdWithExtraneousSelector < Linter include LinterRegistry def visit_simple_sequence(seq) id_sel = seq.members.find { |simple| simple.is_a?(Sass::Selector::Id) } return unless id_sel can_be_simplified = seq.members.any? do |simple| !simple.is_a?(Sass::Selector::Id) && !simple.is_a?(Sass::Selector::Pseudo) end return unless can_be_simplified add_lint(seq.line, "Selector `#{seq}` can be simplified to `#{id_sel}`, " \ 'since IDs should be uniquely identifying') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
scss-lint-0.30.0 | lib/scss_lint/linter/id_with_extraneous_selector.rb |
scss-lint-0.29.0 | lib/scss_lint/linter/id_with_extraneous_selector.rb |