htmlhint / SublimeLinter-contrib-htmlhint

A SublimeLinter plugin for HTML, using HTMLHint.
MIT License
34 stars 5 forks source link

`htmlhint` lints all files, not just HTML files #20

Open tukusejssirs opened 3 years ago

tukusejssirs commented 3 years ago

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:

tukusejssirs commented 3 years ago

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.

Monox18 commented 1 year ago

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.