SublimeLinter-contrib-htmlhint icon indicating copy to clipboard operation
SublimeLinter-contrib-htmlhint copied to clipboard

`htmlhint` lints all files, not just HTML files

Open tukusejssirs opened this issue 4 years ago • 2 comments
trafficstars

Describe the bug htmlhint lints all files, not just HTML files.

To Reproduce Steps to reproduce the behavior:

  1. Open a non-HTML file (e.g. Markdown, PHP, …)
  2. Open the linter log and see that it raises some errors (e.g. in my case it raises doctype-first and tag-pair errors.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots htmlhint lints only HTML.

Desktop (please complete the following information):

I don’t think this is OS-dependent, however, below is my platform:

  • OS: Fedora 31 x86_64
  • Browser n/a
  • Version SublimeLinter-contrib-htmlhint v2.0.1

tukusejssirs avatar Jan 25 '21 09:01 tukusejssirs

I was able to work around this by adding the following int SublimeLinter settings (see the docs:

"htmlhint": {
  "selector": "source.html"
}

However, I still think that that should the default setting.

tukusejssirs avatar Jan 25 '21 10:01 tukusejssirs

Thanks for the suggestion, In my case, source.html disabled my linter. Html files report a different source in SublimeText so I modified it to:

"htmlhint": {
  "selector": "text.html.basic"
}

and made a pull request to update the default settings.

Monox18 avatar Jun 15 '23 10:06 Monox18