BenoitZugmeyer / eslint-plugin-html

An ESLint plugin to extract and lint scripts from HTML files.
ISC License
430 stars 51 forks source link

Allow YAML headers? #18

Closed tmcw closed 8 years ago

tmcw commented 8 years ago

For HTML pages used with Jekyll (like our code examples https://www.mapbox.com/mapbox-gl-js/api/ ), the page starts with a YAML header: https://github.com/mapbox/mapbox-gl-js/blob/master/docs/_posts/examples/3400-01-05-popup.html#L1-L6

Ideally eslint-plugin-html would be able to ignore this header and still parse the HTML. Would you accept a PR implementing that change?

BenoitZugmeyer commented 8 years ago

Thank you for your interest, but I am not convinced about this. As long as you don't have any <script> tag inside the yaml header, it should already work without any trouble. Proof: remove the code you added in extract.js and run the new test: it passes, except for the column test which is wrong anyway (the console.log statement starts at the 7th column, not the first one).

Am I missing something?

BenoitZugmeyer commented 8 years ago

Closing this for now, feel free to reply to my comment if you want this to move forward.