Skip to content

Commit 83d9bdd

Browse files
matsieftwuna
authored andcommitted
Remove sass-lint and replace with stylelint. Create new stylelintrc and install new dependencies. (#264)
1 parent d11fdda commit 83d9bdd

5 files changed

Lines changed: 93 additions & 47 deletions

File tree

.stylelintrc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"plugins": [
3+
"stylelint-scss",
4+
"stylelint-declaration-block-order"
5+
],
6+
"rules": {
7+
number-leading-zero: always,
8+
value-list-comma-newline-after: always,
9+
value-list-comma-space-after: always,
10+
declaration-bang-space-after: always,
11+
declaration-bang-space-before: never,
12+
declaration-colon-space-after: always,
13+
declaration-colon-space-before: never,
14+
declaration-no-important: true,
15+
declaration-block-no-duplicate-properties: true,
16+
declaration-block-no-ignored-properties: true,
17+
declaration-block-no-redundant-longhand-properties: true,
18+
declaration-block-semicolon-newline-after: always,
19+
declaration-block-single-line-max-declarations: 1,
20+
declaration-block-trailing-semicolon: always,
21+
block-closing-brace-empty-line-before: never,
22+
block-closing-brace-newline-after: always,
23+
block-closing-brace-space-before: always,
24+
block-no-empty: true,
25+
block-no-single-line: true,
26+
block-opening-brace-newline-after: always-multi-line,
27+
block-opening-brace-space-before: always-single-line,
28+
selector-no-id: true,
29+
at-rule-semicolon-newline-after: true,
30+
at-rule-no-unknown: true,
31+
at-rule-name-case: lower,
32+
comment-empty-line-before: always,
33+
comment-no-empty: true,
34+
comment-whitespace-inside: always,
35+
indentation: 2,
36+
max-nesting-depth: 1,
37+
no-duplicate-selectors: true,
38+
no-eol-whitespace: true,
39+
no-extra-semicolons: true,
40+
no-invalid-double-slash-comments: true,
41+
no-missing-end-of-source-newline: true,
42+
"plugin/declaration-block-order": [
43+
{
44+
type: 'at-rule',
45+
name: extend
46+
},
47+
{
48+
type: 'at-rule',
49+
name: mixin
50+
},
51+
'declarations'
52+
]
53+
}
54+
}

gulpfile.js

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ var gulp = require('gulp'),
1515
plumber = require('gulp-plumber'),
1616
deploy = require('gulp-gh-pages'),
1717
notify = require('gulp-notify'),
18-
sassLint = require('gulp-sass-lint'),
19-
twig = require('gulp-twig'),
18+
twig = require('gulp-twig');
19+
gulpStylelint = require('gulp-stylelint')
2020
runSequence = require('run-sequence'),
2121
del = require('del');
2222

@@ -94,11 +94,35 @@ gulp.task('site-scss', function() {
9494
.pipe(reload({stream:true}));
9595
});
9696

97-
gulp.task('sass-lint', function () {
98-
gulp.src('scss/**/*.scss')
99-
.pipe(sassLint())
100-
.pipe(sassLint.format())
101-
.pipe(sassLint.failOnError());
97+
gulp.task('browser-sync', function() {
98+
browserSync({
99+
server: {
100+
baseDir: "site"
101+
}
102+
});
103+
});
104+
105+
gulp.task('deploy', function () {
106+
return gulp.src('site/**/*')
107+
.pipe(deploy());
108+
});
109+
110+
gulp.task('lint-css', function lintCssTask() {
111+
const gulpStylelint = require('gulp-stylelint');
112+
const myStylelintFormatter = require('my-stylelint-formatter');
113+
114+
return gulp
115+
.src('src/**/*.css')
116+
.pipe(gulpStylelint({
117+
failAfterError: true,
118+
reportOutputDir: 'reports/lint',
119+
reporters: [
120+
{formatter: 'verbose', console: true},
121+
{formatter: 'json', save: 'report.json'},
122+
{formatter: myStylelintFormatter, save: 'my-custom-report.txt'}
123+
],
124+
debug: true
125+
}));
102126
});
103127

104128
gulp.task('jshint', function() {

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,18 @@
3131
"gulp-imagemin": "^3.0.3",
3232
"gulp-notify": "^2.2.0",
3333
"gulp-plumber": "^1.1.0",
34+
"gulp-postcss": "^6.2.0",
3435
"gulp-rename": "^1.2.2",
3536
"gulp-sass": "^2.3.2",
36-
"gulp-sass-lint": "1.2.0",
3737
"gulp-size": "^2.1.0",
38+
"gulp-stylelint": "^3.4.0",
3839
"gulp-twig": "~0.5.0",
3940
"gulp-uglify": "^2.0.0",
4041
"imagemin-pngquant": "^5.0.0",
42+
"postcss-reporter": "^1.4.1",
43+
"stylelint": "^7.5.0",
44+
"stylelint-declaration-block-order": "^0.2.0",
45+
"stylelint-scss": "^1.3.4"
4146
"run-sequence": "^1.2.2"
4247
}
4348
}

sass-lint.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

site/css/demo-site.css

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,16 +1208,13 @@ img {
12081208
.demo__list {
12091209
width: 100%;
12101210
display: -webkit-box;
1211-
display: -webkit-flex;
12121211
display: -ms-flexbox;
12131212
display: flex;
12141213
-webkit-box-pack: center;
1215-
-webkit-justify-content: center;
12161214
-ms-flex-pack: center;
12171215
justify-content: center;
1218-
-webkit-flex-wrap: wrap;
1219-
-ms-flex-wrap: wrap;
1220-
flex-wrap: wrap; }
1216+
-ms-flex-wrap: wrap;
1217+
flex-wrap: wrap; }
12211218

12221219
.demo__item {
12231220
margin: .75em;

0 commit comments

Comments
 (0)