Skip to content

Commit 8cafdfc

Browse files
committed
Add linting-as-you type support with htmlhint's new stdin feature (htmlhint/HTMLHint#97). Updates version requirement of htmlhint to 0.9.13. Resolves #5.
1 parent 608c646 commit 8cafdfc

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Before using this plugin, you must ensure that `htmlhint` is installed on your s
2020

2121
1. If you are using `nvm` and `zsh`, ensure that the line to load `nvm` is in `.zshenv` and not `.zshrc`.
2222

23-
**Note:** This plugin requires `htmlhint` 0.9.10 or greater. Upgrade your existing installation by running step 2 above.
23+
**Note:** This plugin requires `htmlhint` 0.9.13 or greater. Upgrade your existing installation by running step 2 above.
2424

2525
### Linter configuration
2626
In order for `htmlhint` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. Before going any further, please read and follow the steps in [“Finding a linter executable”](http://sublimelinter.readthedocs.org/en/latest/troubleshooting.html#finding-a-linter-executable) through “Validating your PATH” in the documentation.

linter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ class Htmlhint(Linter):
1919
"""Provides an interface to htmlhint."""
2020

2121
syntax = 'html'
22-
cmd = ('htmlhint', '--format', 'json')
22+
cmd = ('htmlhint', '--format', 'json', '--nocolor', 'stdin')
2323
version_args = '--version'
2424
version_re = r'(?P<version>\d+\.\d+\.\d+)'
25-
version_requirement = '>= 0.9.10'
25+
version_requirement = '>= 0.9.13'
2626
# empty regex so plugin initializes properly
2727
regex = r''
28-
tempfile_suffix = '-'
2928
config_file = ('--config', '.htmlhintrc', '~')
3029

3130
def find_errors(self, output):

messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"install": "messages/install.txt",
33
"1.0.1": "messages/1.0.1.txt",
44
"1.1.0": "messages/1.1.0.txt",
5-
"1.1.1": "messages/1.1.1.txt"
5+
"1.1.1": "messages/1.1.1.txt",
6+
"1.1.2": "messages/1.1.2.txt"
67
}

messages/1.1.2.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SublimeLinter-contrib-htmlhint 1.1.2
2+
------------------------------------
3+
This plugin has been updated to handle htmlhint's new stdin input feature. This means errors will be reported as you type them, rather than when you save.
4+
5+
*** NOTE: htmlhint version 0.9.13 and greater is now required. ***
6+
7+
Upgrade your existing htmlhint to the latest by running:
8+
npm install -g htmlhint@latest
9+
10+
Please refer to https://github.com/mmaday/SublimeLinter-contrib-htmlhint for complete installation instructions.

0 commit comments

Comments
 (0)