Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function scssLint() {
console.log('---------------SASS LINTING---------------');
return src('src/assets/scss/**/*.scss')
.pipe(sassLint({
configFile: '.scss-lint.yml'
}))
.pipe(sassLint.format())
.pipe(sassLint.failOnError());
}
function scssLint() {
console.log('---------------SASS LINTING---------------');
return src('src/assets/scss/**/*.scss')
.pipe(sassLint({
configFile: '.scss-lint.yml'
}))
.pipe(sassLint.format())
.pipe(sassLint.failOnError());
}
gulp.task('styles', function() {
let output = debug ? 'nested' : 'compressed';
return gulp.src(assets + '/styles/scss/main.scss')
.pipe(gulpif(debug,sourcemaps.init()))
.pipe(gulpif(debug,sassLint()))
.pipe(gulpif(debug,sassLint.format()))
.pipe(gulpif(debug,sassLint.failOnError()))
.pipe(sass({includePaths: ['./node_modules/'], outputStyle: output}) .on('error', sass.logError))
.pipe(autoprefixer({ browsers: ['last 2 versions', '> 5%'] }))
.pipe(gulpif(debug,sourcemaps.write()))
.pipe(gulp.dest(assets + '/styles'))
.pipe(livereload())
.pipe(notify({ message: 'CSS complete' }));
});
gulp.task('styles', function() {
let output = debug ? 'nested' : 'compressed';
return gulp.src(assets + '/styles/scss/main.scss')
.pipe(gulpif(debug,sourcemaps.init()))
.pipe(gulpif(debug,sassLint()))
.pipe(gulpif(debug,sassLint.format()))
.pipe(gulpif(debug,sassLint.failOnError()))
.pipe(sass({includePaths: ['./node_modules/'], outputStyle: output}) .on('error', sass.logError))
.pipe(autoprefixer({ browsers: ['last 2 versions', '> 5%'] }))
.pipe(gulpif(debug,sourcemaps.write()))
.pipe(gulp.dest(assets + '/styles'))
.pipe(livereload())
.pipe(notify({ message: 'CSS complete' }));
});
gulp.task('scss:lint', () => {
return gulp.src([
configPaths.app + '**/*.scss',
configPaths.src + '**/*.scss'
])
.pipe(sasslint())
.pipe(sasslint.format())
.pipe(sasslint.failOnError())
})
gulp.task('lint', function(callback) {
return gulp.src(global.config.src + '/**/*.scss')
.pipe(sassLint({
configFile: global.path + '/.sass-lint.yml'
}))
.pipe(sassLint.format())
.pipe(sassLint.failOnError())
.on('close', callback);
});
gulp.task('lint:sass', 'Lint the SASS files.', () => {
return gulp.src([paths.allSrcSass, paths.allExampleSass])
.pipe(sassLint())
.pipe(sassLint.format())
.pipe(sassLint.failOnError());
});
lintSass: function() {
return src([
'./src/patterns/{global,layout,components}/**/*.scss',
'!./src/patterns/global/utils/*'
])
.pipe(sassLint())
.pipe(sassLint.format());
},
gulp.task('scss:lint', () => {
return gulp.src([
configPaths.app + '**/*.scss',
configPaths.src + '**/*.scss'
])
.pipe(sasslint())
.pipe(sasslint.format())
.pipe(sasslint.failOnError())
})
gulp.task('lint', function(callback) {
return gulp.src(global.config.src + '/**/*.scss')
.pipe(sassLint({
configFile: global.path + '/.sass-lint.yml'
}))
.pipe(sassLint.format())
.pipe(sassLint.failOnError())
.on('close', callback);
});