gulp-htmlhint
gulp-htmlhint copied to clipboard
Rules are not working
I have tried 3 different ways of declaring custom rules, neither of them worked.
Referencing a .htmlhintrc
file:
gulp.task('htmllint', function() {
return gulp.src(settings.app.base + "/index.html")
.pipe(htmllint('.htmlhintrc', htmllintReporter));
});
Referencing a htmlhintrc.json
file:
gulp.task('htmllint', function() {
return gulp.src(settings.app.base + "/index.html")
.pipe(htmllint('htmlhintrc.json', htmllintReporter));
});
And referencing the object inline:
gulp.task('htmllint', function() {
return gulp.src(settings.app.base + "/index.html")
.pipe(htmllint({ "tag-pair": true, "title-require": false }, htmllintReporter));
});
Other than that I always get the following error: (E015) line ending does not match format: lf
and I have found no documentation for this at https://github.com/yaniswang/HTMLHint/wiki/Rules
Referencing the htmlhtintrc file like this works for me:
gulp.task('htmlhint', function () {
return gulp.src([
'*.html',
'app/**/*.html',
'ext/**/*.html'
])
.pipe(htmlhint({
htmlhintrc: './.htmlhintrc'
}))
.pipe(htmlhint.reporter())
.pipe(htmlhint.failReporter({ suppress: true }));
});
@gaboratorium I doubt this is still relevant in 2019, but your not using htmlHint.reporter() and you need to.