validator/grunt-html

specifying options per file list

dzfranklin opened this issue · 1 comments

First, thank you for this great plugin.

It appears that the options property can only be set on htmllint, not specific sub-tasks.

htmllint: {
    foo_action: ["file_foo.html"],
    bar_action: ["file_bar.html"],
    options: {
        // options for foo_action and bar_action
    }
}

If possible, something along the lines of the example below would be much more useful for me

htmllint: {
    foo_action: {
       files: ["file_foo.html"],
       options: {
           // foo specific options
       }
    },
    bar_action: {
       files: ["file_foo.html"],
       options: {
           // bar specific options
       }
    },
    options: {
       // options for foo and bar actions
    }
}

Is this possible? Am I missing something in the instructions?

Sorry for the late response. Yes, you're missing something, though the instructions could make this more obvious (its a general grunt feature though). In your sample, replace files with src and you're good to go. See this project's Gruntfile for a sample.