Skip to content

Commit 568071d

Browse files
Programatic use of linter - Update README.md (#1430)
Adds programatic use of linter in JavaScript code.
1 parent 0ea5f32 commit 568071d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ $ ./node_modules/.bin/htmlhint www/index.html
5353
$ ./node_modules/.bin/htmlhint www/**/*.html
5454
```
5555

56+
Or, you can use HTMLHint linter programatically, like this:
57+
```
58+
import { HTMLHint } from 'htmlhint';
59+
const htmlVerificationHints = HTMLHint.verify(localHtmlContent);
60+
console.log('htmlVerificationHints', htmlVerificationHints); // this logs a list of `Hint`s which contain information on all linting errors
61+
```
62+
5663
### Global Installation and Usage
5764

5865
If you want to make HTMLHint available to tools that run across all of your projects, you can install HTMLHint globally using npm:

0 commit comments

Comments
 (0)