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

Feature Request: being able to pass it a list of url's

Open branneman opened this issue 10 years ago • 3 comments

Since a lot of people are using grunt to validate source code —and not built files, such as minified javascript— it would be nice if grunt-htmlhint would also support linting url's, instead of only files.

Say you're using a local node.js server with a template engine like Swig, and you'd want to check your html before the build, so you can fail the build if necessary. Like refusing to optimize require.js with r.js if there are JSHint errors. frntndr is an example of such a project. Who has the full html for a single page inside one file nowadays?

For this to work, I'd be nice if grunt-htmlhint could validate url's as well. Since running htmlhint over swig files will naturally fail, there needs to be a way of validating combined html from several template files. Like the grunt-htmllint-http plugin does. But ideally you wouldn't want another grunt plugin for that if you ask me.

I could see an example config like this:

htmlhint: {
  options: {
    'tag-pair': true
  },
  dist: {
    src: [
      'http://localhost/',
      'http://localhost/articles.html'
    ]
  }
}

But this is of course only a proposal, maybe a different way of specifying url's makes more sense?

Edit: I could help with the development of this feature, if you agree this would be a nice addition.

branneman avatar Jun 08 '14 11:06 branneman

In my company, we use proxy to validate html code. So can support every type of template. And can support online webpage.

We use pageRun: https://github.com/yaniswang/pageRun

yaniswang avatar Jun 21 '14 14:06 yaniswang

@yaniswang Wish if there will be a option for ignore some templates content and let htmlhint pass. Because it might be too heavy to run webdriver only for some template syntax and variables.

poppinlp avatar Apr 01 '15 04:04 poppinlp

<%if%>
<div>
<%else%>
<div>
<%end%>
</div>

Show me how ignore templates content.

yaniswang avatar Apr 02 '15 01:04 yaniswang