Integrates the HTMLHint static analysis tool into Visual Studio Code.
The HTMLHint extension will attempt to use the locally installed HTMLHint module (the project-specific module if present, or a globally installed HTMLHint module). If a locally installed HTMLHint isn't available, the extension will use the embedded version (current version 0.9.13).
To install a version to the local project folder, run
The HTMLHint extension will run HTMLHint on your open HTML files and report the number of errors on the Status Bar with details in the Problems panel (View > Problems).
Errors in HTML files are highlighted with squiggles and you can hover over the squiggles to see the error message.
The HTMLHint extension uses the default rules provided by HTMLHint.
If you'd like to modify the rules, you can provide a
You can learn more about rule configuration at the HTMLHint Usage page.
Additional file types
By default, HTMLHint will run on any files associated with the "html" language service (i.e., ".html" and ".htm" files). If you'd like to use the HTMLHint extension with additional file types, you have two options:
Option 1: Treating your file like any other html file
If you would like the file type to be treated as any other html file (including syntax highlighting, as well as HTMLHint linting), you'll need to associate the extension with the html language service. Add the following to your VS Code settings, replacing
Option 2: Associating HTMLHint extension with your file type
If your file type already has an associated language service other than "html", and you'd like HTMLHint to process those file types, you will need to associate the HTMLHint extension with that language service. Add the following to your VS Code settings, replacing
The HTMLHint extension provides three settings:
You can change settings globally (File > Preferences > User Settings) or per workspace (File > Preferences > Workspace Settings). The Preferences menu is under Code on macOS.
Here's an example using the
Note that in order to have the linter apply to addi