ricardofbarros / linter-js-standard

Atom linter plugin for JavaScript, using JavaScript Standard Style
https://atom.io/packages/linter-js-standard
MIT License
99 stars 50 forks source link

ignore non-javascript script-tags in html #182

Open TomTasche opened 7 years ago

TomTasche commented 7 years ago

i'm commonly (ab)using script-tags to store html, but linter spits out warnings for every line of html inside the script-tag because it tries to validate it as javascript. this is of course intended behavior, but i'd like to restrict linting to lint only javascript. since most script-tags indeed contain javascript, i'd use blacklist of know types to ignore (i think the same technique is used for other templating frameworks like handlebars?)

  <script type="text/html" id="item-template">
    <li class="item-text"></li>
  </script>

i quickly looked at the code and it seems the best way to do this is pass a settings-object to the html-splitter. any thoughts on this from the maintainers before i start implementing it?

sonicdoe commented 7 years ago

This makes sense, however, I’d prefer simply using the source.js.embedded.html scope instead. See https://github.com/AtomLinter/linter-jshint/pull/132 for how linter-jshint implemented it. PR welcome!