Lint your .less files from Gulp with lesshint.
MIT License
npm install gulp-lesshint --save-dev
const gulp = require('gulp');
const lesshint = require('gulp-lesshint');
gulp.task('lint', () => {
return gulp.src('./src/*.less')
.pipe(lesshint({
// Options
}))
.pipe(lesshint.reporter('reporter-name')) // Leave empty to use the default, "stylish"
.pipe(lesshint.failOnError()) // Use this to fail the task on lint errors
.pipe(lesshint.failOnWarning()); // Use this to fail the task on lint warnings
});
configPath
.lesshintrc
file.maxWarnings
lesshint.failOnError()
error
.lesshint.failOnWarning()
warning
.NOTE: this does not respect the maxWarnings
option.If no reporter name is passed, the default lesshint-reporter-stylish
will be used which just prints everything with different colors.
If you wish to specify your own, please refer to the lesshint reporter loading steps
for the exact logic.
The following properties will be added to the file
object.
file.lesshint.success = true; // or false
file.lesshint.resultCount = 0; // number of results returned by lesshint
file.lesshint.results = []; // lesshint results