gulp-htmlhint icon indicating copy to clipboard operation
gulp-htmlhint copied to clipboard

Rules are not working

Open gaboratorium opened this issue 7 years ago • 2 comments

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

gaboratorium avatar Jul 19 '16 19:07 gaboratorium

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 }));
});

olore avatar Sep 23 '16 12:09 olore

@gaboratorium I doubt this is still relevant in 2019, but your not using htmlHint.reporter() and you need to.

fifn2 avatar Feb 14 '19 01:02 fifn2