Answer the question
In order to leave comments, you need to log in
How to use gulp-stylelint with gulp-sass?
I collect styles using gulp-sass. I lint with gulp-stylelint.
There are several input files, each of which is collected separately. Each file has an import.
Tell me how to lint styles before compiling them, but including linting files via import.
Function for compiling styles
const gulp = require('gulp');
const sass = require('gulp-sass');
const plumber = require('gulp-plumber');
const gulpStylelint = require('gulp-stylelint');
function compileStyles(src, dest) {
return gulp.src(src)
.pipe(plumber({
errorHandler: console.error
}))
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(dest));
}
function lintStyles(src) {
return gulp.src(src)
.pipe(gulpStylelint({
failAfterError: true,
reporters: [
{formatter: 'string', console: true}
]
}));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question