scss-lint 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'sass'
|
2
|
+
|
3
|
+
module SCSSLint
|
4
|
+
class Linter::SingleLinePerSelector < Linter
|
5
|
+
include LinterRegistry
|
6
|
+
|
7
|
+
class << self
|
8
|
+
def run(engine)
|
9
|
+
lints = []
|
10
|
+
engine.tree.each do |node|
|
11
|
+
if node.is_a?(Sass::Tree::RuleNode)
|
12
|
+
lints << check_selector_format(node)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
lints.compact
|
16
|
+
end
|
17
|
+
|
18
|
+
def description
|
19
|
+
'Each selector should be on its own line'
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def check_selector_format(rule_node)
|
25
|
+
create_lint(rule_node) unless rule_node.rule.grep(/,[^\n]/).empty?
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/scss_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scss-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/scss_lint/linter/declaration_order_linter.rb
|
76
76
|
- lib/scss_lint/linter/empty_rule_linter.rb
|
77
77
|
- lib/scss_lint/linter/debug_linter.rb
|
78
|
+
- lib/scss_lint/linter/single_line_per_selector_linter.rb
|
78
79
|
- lib/scss_lint/linter/sorted_properties_linter.rb
|
79
80
|
- lib/scss_lint/linter/shorthand_linter.rb
|
80
81
|
- lib/scss_lint/linter/property_format_linter.rb
|