microsoft / vscode-htmlhint

VS Code integration of HTMLHint, an HTML linter.
MIT License
50 stars 35 forks source link

Conditionally apply rules #90

Closed mmahacek closed 2 years ago

mmahacek commented 2 years ago

Is there a way to conditionally set rules to enable/disable?

Use case: I'm building a Flask site and using multiple HTML files that use jinja includes to render as a single page. On my master page, I do want doctype-first to apply, but if the first line of other files starts with {% extends ... or {% block... I don't need to have a doctype-first check as the file isn't an independent page. It would be helpful if I could set that rule to ignore files (or just pass as valid) if the page starts with a jinja code block.

AstraNoel commented 2 years ago

Yes, the rules are customizable. You can follow the instruction in VSMarketplace

mmahacek commented 2 years ago

Those customizations turn the rule on or off, not allow for a conditional to apply the rule to some pages but not others. Doesn't really answer my use case, though I'll close this request.