-
Notifications
You must be signed in to change notification settings - Fork 95
Opinionated HTML rules #78
Comments
Correct. In the AST, an HTML fragment is just a string. However, Yishu recently introduced an HTML parser, to lint HTML inside translations: https://github.com/Shopify/theme-check/blob/master/lib/theme_check/checks/valid_html_translation.rb#L23-L31 I think we could introduce a new type of check: How do we differentiate between HTML rules we should implement, and those we would leave to other existing HTML linters? <script> without async or defer. That should not exist. And theme-check seems like a logical place to suggest/enforce this. What if we introduced a better version of the
Then implement a check to deprecate
Oh yeah, we need this! I'll create an issue. |
Hmm yup! Had in mind to add support for One annoying thing here: As soon as we give two options, users might obsess over which one is better when it doesn't matter as much as putting one of either. Considering suggesting Would suggest of type |
Say goodbye to slow sites. Adds friction to under performing HTML. Fixes #78
Say goodbye to slow sites. Adds friction to under performing HTML. Fixes #78
As I understand it, the AST doesn't really recognize the HTML as HTML. Am I wrong here? Looks like there would be some gain to be had by linting HTML as well. But might be complicated.
What I'd really like is some opinionated checks that prevent stuff like:
But really it's mostly about <script> without async or defer. That should not exist. And theme-check seems like a logical place to suggest/enforce this.
Also perhaps an opportunity to add magic comments to disable rules? À la
// eslint-disable-line camel-case
The text was updated successfully, but these errors were encountered: