Skip to content

Commit

Permalink
Stylelint YAML config
Browse files Browse the repository at this point in the history
  • Loading branch information
Igloczek committed Apr 7, 2016
1 parent df20ba0 commit 126e816
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
18 changes: 18 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
rules:
color-no-invalid-hex: true
time-no-imperceptible: true
# declaration-block-no-duplicate-properties: true #to do - too many errors
declaration-block-no-ignored-properties: true
# declaration-block-no-shorthand-property-overrides: true #to do - too many errors
block-no-empty: true
# selector-no-attribute: true # to do - too many errors
selector-no-id: true
no-unknown-animations: true
no-browser-hacks:
- true
-
browsers: '> 1%, last 2 versions, not ie < 11, not OperaMini >= 5.0'
# no-unsupported-browser-features:
# - true # to do - too many errors
# -
# browsers: '> 1%, last 2 versions, not ie < 11, not OperaMini >= 5.0'
20 changes: 1 addition & 19 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
var gulp = require('gulp'),
sass = require('gulp-sass'),
plumber = require('gulp-plumber'),
gutil = require('gulp-util'),
postcss = require('gulp-postcss'),
reporter = require('postcss-reporter'),
stylelint = require('stylelint'),
sassLint = require('gulp-sass-lint');

// Rewrite to YAML and then move to .stylelintrc, b/c JSON don't support comments
var cssStylelintConfig = {
"rules": {
"color-no-invalid-hex": true,
"time-no-imperceptible": true,
// "declaration-block-no-duplicate-properties": true, // to do - too many errors
// "declaration-block-no-ignored-properties": true, // to enable in >=5.3.0
"declaration-block-no-shorthand-property-overrides": true,
"block-no-empty": true,
// "selector-no-attribute": true, // to do - too many errors
"selector-no-id": true,
"no-unknown-animations": true,
"no-browser-hacks": [true, {"browsers": "> 1%, last 2 versions, not ie < 11, not OperaMini >= 5.0"}],
// "no-unsupported-browser-features": [true, {"browsers": "> 1%, last 2 versions, not ie < 11, not OperaMini >= 5.0"}] // to do - too many errors
}
};

gulp.task('default', () => {
gulp.watch(['**/*.scss','!node_modules/**'], () => {
gulp.src('web/css/*.scss')
Expand Down Expand Up @@ -69,7 +51,7 @@ gulp.task('sass', () => {
gulp.task('css-lint', () => {
return gulp.src('web/css/*.css')
.pipe(postcss([
stylelint(cssStylelintConfig),
stylelint(),
reporter({
clearMessages: true,
throwError : true
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
"engine": "node >= 4.2.6",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-csslint": "^0.2.2",
"gulp-plumber": "^1.1.0",
"gulp-postcss": "^6.1.0",
"gulp-sass": "^2.2.0",
"gulp-sass-lint": "^1.1.1",
"gulp-util": "^3.0.7",
"postcss-reporter": "^1.3.3",
"stylelint": "^5.2.1"
"stylelint": "^5.3.0"
}
}

0 comments on commit 126e816

Please sign in to comment.