validator/grunt-html

Ignore option not recognised

alexanderthurn opened this issue · 3 comments

The 'ignore' option seemes to be ignored...

...
ignore: ['Start tag seen without seeing a doctype first. Expected “”.',
...
app/views/about.html [L1:C3] Start tag seen without seeing a doctype first. Expected “”.

Example:
http://feuerware.com/temp/ignore_problem.zip

npm update
npm install
grunt htmllint

You have only defined the ignore rules for the target named "ignore", not for the target named "all".

So when you run grunt htmllint (without specifying a target) you will run every target, starting with "all". Since this target hasn't defined any ignores, it will produce warnings and not continue to the next target, unless you specify --force.

Your target "ignore" will work as expected if you run it explicitly:
grunt htmllint:ignore

Alright, the doc was not 100% clear for me...

I changed my gruntfile and it works now. Thanks a lot.

  htmllint: {
            all: {
                options: {
                    ignore: ['Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.']
                },
                src: ['<%= yeoman.app %>/views/**/*.html','<%= yeoman.app %>/*.html']
            }
        },

I've updated the readme, should help avoid that issue in the future.