S
S
someserj2017-03-19 00:34:43
JavaScript
someserj, 2017-03-19 00:34:43

How to validate HTML (Gulp)?

the task is to validate HTML according to W3C from Gulp, and without stopping the work of gulp.
I'm trying this plugin https://www.npmjs.com/package/gulp-htmllint
can't disable extra checks for lowercase, underscore, etc. I would also like to enable checking for BEM syntax, it does not work by default.
here is something about these points https://github.com/htmllint/htmllint/wiki/Options I try to true/follow them, but still these errors keep pouring in and the bem check does not work

.pipe(htmllint({
            "lowercase" : false,
            "bem" : true
        }, htmllintReporter))

how to make this plugin work or can you recommend another one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2017-03-19
@sim3x

According to
https://github.com/yvanavermaet/gulp-htmllint/blob...
it expects something like this

.pipe(htmllint(
{ 'rules': {
            "lowercase" : false,
            "bem" : true
        }
}, htmllintReporter))

K
Konstantin   , 2017-03-23
@SynCap

By default, gulp-htmllint takes the validation rules from `.htmllintrc`.
You can use ` htmllint-cli
to create it. Tweak the rest manually and run the task without specifying additional options.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question