Skip to content

Commit 5d8f5c7

Browse files
committed
Added scss-lint + fixed scss files.
1 parent 904f68b commit 5d8f5c7

20 files changed

+396
-120
lines changed

gulpfile.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ gulp.task('csslint', ['styles'], function() {
7575
;
7676
});
7777

78+
gulp.task('scsslint', ['styles'], function() {
79+
var scsslint = g.scssLint;
80+
81+
return gulp.src('./src/app/**/*.scss')
82+
.pipe(scsslint({
83+
config: './scsslint.yml'
84+
}));
85+
});
86+
7887
/**
7988
* Scripts
8089
*/
@@ -218,7 +227,7 @@ gulp.task('watch', ['statics', 'default'], function() {
218227

219228
gulp.watch('./src/app/index.html', ['index']);
220229
gulp.watch(['./src/app/**/*.html', '!./src/app/index.html'], ['templates']);
221-
gulp.watch(['./src/app/**/*.scss'], ['csslint']).on('change', function(evt) {
230+
gulp.watch(['./src/app/**/*.scss'], ['csslint', 'scsslint']).on('change', function(evt) {
222231
if (evt.type !== 'changed') {
223232
gulp.start('index');
224233
}
@@ -233,7 +242,7 @@ gulp.task('default', ['lint', 'build-all']);
233242
/**
234243
* Lint everything
235244
*/
236-
gulp.task('lint', ['jshint', 'csslint']);
245+
gulp.task('lint', ['jshint', 'csslint', 'scsslint']);
237246

238247
/**
239248
* Test

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"gulp-rename": "1.2.2",
3838
"gulp-replace-task": "0.11.0",
3939
"gulp-sass": "2.1.0",
40+
"gulp-scss-lint": "0.3.7",
4041
"gulp-serve": "1.2.0",
4142
"gulp-uglify": "1.4.2",
4243
"gulp-util": "3.0.7",

scsslint.yml

+234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
# Default application configuration that all configurations inherit from.
2+
3+
scss_files: "**/*.scss"
4+
plugin_directories: ['.scss-linters']
5+
6+
# List of gem names to load custom linters from (make sure they are already
7+
# installed)
8+
plugin_gems: []
9+
10+
linters:
11+
BangFormat:
12+
enabled: true
13+
space_before_bang: true
14+
space_after_bang: false
15+
16+
BemDepth:
17+
enabled: false
18+
max_elements: 1
19+
20+
BorderZero:
21+
enabled: true
22+
convention: zero # or `none`
23+
24+
ColorKeyword:
25+
enabled: true
26+
27+
ColorVariable:
28+
enabled: true
29+
30+
Comment:
31+
enabled: true
32+
33+
DebugStatement:
34+
enabled: true
35+
36+
DeclarationOrder:
37+
enabled: true
38+
39+
DisableLinterReason:
40+
enabled: false
41+
42+
DuplicateProperty:
43+
enabled: true
44+
45+
ElsePlacement:
46+
enabled: true
47+
style: same_line # or 'new_line'
48+
49+
EmptyLineBetweenBlocks:
50+
enabled: true
51+
ignore_single_line_blocks: true
52+
53+
EmptyRule:
54+
enabled: true
55+
56+
ExtendDirective:
57+
enabled: false
58+
59+
FinalNewline:
60+
enabled: true
61+
present: true
62+
63+
HexLength:
64+
enabled: true
65+
style: short # or 'long'
66+
67+
HexNotation:
68+
enabled: true
69+
style: lowercase # or 'uppercase'
70+
71+
HexValidation:
72+
enabled: true
73+
74+
IdSelector:
75+
enabled: true
76+
77+
ImportantRule:
78+
enabled: true
79+
80+
ImportPath:
81+
enabled: true
82+
leading_underscore: false
83+
filename_extension: false
84+
85+
Indentation:
86+
enabled: true
87+
allow_non_nested_indentation: false
88+
character: space # or 'tab'
89+
width: 2
90+
91+
LeadingZero:
92+
enabled: true
93+
style: exclude_zero # or 'include_zero'
94+
95+
MergeableSelector:
96+
enabled: true
97+
force_nesting: true
98+
99+
NameFormat:
100+
enabled: true
101+
allow_leading_underscore: true
102+
convention: hyphenated_lowercase # or 'camel_case', or 'snake_case', or a regex pattern
103+
104+
NestingDepth:
105+
enabled: true
106+
max_depth: 10
107+
ignore_parent_selectors: false
108+
109+
PlaceholderInExtend:
110+
enabled: true
111+
112+
PropertyCount:
113+
enabled: false
114+
include_nested: false
115+
max_properties: 10
116+
117+
PropertySortOrder:
118+
enabled: true
119+
ignore_unspecified: false
120+
min_properties: 2
121+
separate_groups: false
122+
123+
PropertySpelling:
124+
enabled: true
125+
extra_properties: []
126+
127+
PropertyUnits:
128+
enabled: true
129+
global: [
130+
'ch', 'em', 'ex', 'rem', # Font-relative lengths
131+
'cm', 'in', 'mm', 'pc', 'pt', 'px', 'q', # Absolute lengths
132+
'vh', 'vw', 'vmin', 'vmax', # Viewport-percentage lengths
133+
'deg', 'grad', 'rad', 'turn', # Angle
134+
'ms', 's', # Duration
135+
'Hz', 'kHz', # Frequency
136+
'dpi', 'dpcm', 'dppx', # Resolution
137+
'%'] # Other
138+
properties: {}
139+
140+
QualifyingElement:
141+
enabled: true
142+
allow_element_with_attribute: false
143+
allow_element_with_class: false
144+
allow_element_with_id: false
145+
146+
SelectorDepth:
147+
enabled: true
148+
max_depth: 6
149+
150+
SelectorFormat:
151+
enabled: true
152+
convention: hyphenated_lowercase # or 'strict_BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern
153+
154+
Shorthand:
155+
enabled: true
156+
allowed_shorthands: [1, 2, 3]
157+
158+
SingleLinePerProperty:
159+
enabled: true
160+
allow_single_line_rule_sets: true
161+
162+
SingleLinePerSelector:
163+
enabled: true
164+
165+
SpaceAfterComma:
166+
enabled: true
167+
style: one_space # or 'no_space', or 'at_least_one_space'
168+
169+
SpaceAfterPropertyColon:
170+
enabled: true
171+
style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
172+
173+
SpaceAfterPropertyName:
174+
enabled: true
175+
176+
SpaceAfterVariableName:
177+
enabled: true
178+
179+
SpaceAroundOperator:
180+
enabled: true
181+
style: one_space # or 'no_space'
182+
183+
SpaceBeforeBrace:
184+
enabled: true
185+
style: space # or 'new_line'
186+
allow_single_line_padding: false
187+
188+
SpaceBetweenParens:
189+
enabled: true
190+
spaces: 0
191+
192+
StringQuotes:
193+
enabled: true
194+
style: single_quotes # or double_quotes
195+
196+
TrailingSemicolon:
197+
enabled: true
198+
199+
TrailingWhitespace:
200+
enabled: true
201+
202+
TrailingZero:
203+
enabled: false
204+
205+
TransitionAll:
206+
enabled: false
207+
208+
UnnecessaryMantissa:
209+
enabled: true
210+
211+
UnnecessaryParentReference:
212+
enabled: true
213+
214+
UrlFormat:
215+
enabled: true
216+
217+
UrlQuotes:
218+
enabled: true
219+
220+
VariableForProperty:
221+
enabled: false
222+
properties: []
223+
224+
VendorPrefix:
225+
enabled: true
226+
identifier_list: base
227+
additional_identifiers: []
228+
excluded_identifiers: []
229+
230+
ZeroUnit:
231+
enabled: true
232+
233+
Compass::*:
234+
enabled: false

src/app/admin/loginHistory/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h3>
2121
</h3>
2222

2323
<table class="table">
24-
<thead class="noSelect">
24+
<thead class="no-select">
2525
<tr>
2626
<th class="text-nowrap {{item.class}}"
2727
data-ng-repeat="item in titleItems"

src/app/app.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import "styles/_base";
1+
@import 'styles/base';

src/app/core/auth/login/login.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.form-login {
2+
margin: 0 auto;
23
max-width: 250px;
34
padding: 15px;
4-
margin: 0 auto;
55

66
.title {
7-
text-align: center;
87
font-size: 26px;
8+
text-align: center;
99
}
1010

1111
.checkbox {

src/app/examples/author/add.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</div>
1111

1212
<div class="form-group">
13-
<textarea name="author.description" class="form-control" required="required" placeholder="Enter author description"
13+
<textarea name="author.description" class="form-control editable-textarea" required="required" placeholder="Enter author description"
1414
data-ng-model="author.description"
1515
>{book.description}</textarea>
1616
</div>

src/app/examples/author/author.html

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ <h3>
3333
<p style="white-space: pre-line"
3434
data-editable-textarea="author.description"
3535
data-e-name="author.description"
36+
data-e-class="editable-textarea"
3637
data-e-required
3738
>
3839
{{author.description}}

src/app/examples/author/list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h3>
2626
</h3>
2727

2828
<table class="table">
29-
<thead class="noSelect">
29+
<thead class="no-select">
3030
<tr>
3131
<th class="text-nowrap {{item.class}}"
3232
data-ng-repeat="item in titleItems | filter:titleFilter"

src/app/examples/book/add.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</div>
1111

1212
<div class="form-group">
13-
<textarea name="book.description" class="form-control" required="required" placeholder="Enter book description"
13+
<textarea name="book.description" class="form-control editable-textarea" required="required" placeholder="Enter book description"
1414
data-ng-model="book.description"
1515
>{book.description}</textarea>
1616
</div>

src/app/examples/book/book.html

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ <h3>
3333
<p style="white-space: pre-line"
3434
data-editable-textarea="book.description"
3535
data-e-name="book.description"
36+
data-e-class="editable-textarea"
3637
data-e-required
3738
>
3839
{{book.description}}

src/app/examples/book/list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h3>
2626
</h3>
2727

2828
<table class="table">
29-
<thead class="noSelect">
29+
<thead class="no-select">
3030
<tr>
3131
<th class="text-nowrap {{item.class}}"
3232
data-ng-repeat="item in titleItems"

0 commit comments

Comments
 (0)