@@ -42,42 +42,43 @@ There are two ways to install HTMLHint: globally and locally.
42
42
43
43
In case you want to include HTMLHint as part of your project, you can install it locally using npm:
44
44
45
- ```
45
+ ``` bash
46
46
$ npm install htmlhint --save-dev
47
47
```
48
48
49
49
After that, You can run HTMLHint on any file or directory like this:
50
50
51
- ```
51
+ ``` bash
52
52
$ ./node_modules/.bin/htmlhint www/index.html
53
53
$ ./node_modules/.bin/htmlhint www/** /* .html
54
54
```
55
55
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
56
+ Or, you can use HTMLHint linter programmatically, like this:
57
+
58
+ ``` js
59
+ import { HTMLHint } from ' htmlhint'
60
+ const htmlVerificationHints = HTMLHint .verify (localHtmlContent)
61
+ console .log (' htmlVerificationHints' , htmlVerificationHints) // this logs a list of `Hint`s which contain information on all linting errors
61
62
```
62
63
63
64
### Global Installation and Usage
64
65
65
66
If you want to make HTMLHint available to tools that run across all of your projects, you can install HTMLHint globally using npm:
66
67
67
- ```
68
+ ``` bash
68
69
$ npm install htmlhint -g
69
70
```
70
71
71
72
After that, you can run HTMLHint on any file like this:
72
73
73
- ```
74
+ ``` bash
74
75
$ htmlhint www/index.html
75
76
$ htmlhint www/** /* .html
76
77
```
77
78
78
79
You can even launch HTMLHint to analyze an URL:
79
80
80
- ```
81
+ ``` bash
81
82
$ htmlhint https://htmlhint.com/
82
83
```
83
84
@@ -87,20 +88,20 @@ $ htmlhint https://htmlhint.com/
87
88
88
89
Search ` .htmlhintrc ` file in current directory and all parent directories:
89
90
90
- ```
91
+ ``` bash
91
92
$ htmlhint
92
93
$ htmlhint test.html
93
94
```
94
95
95
96
Custom config file:
96
97
97
- ```
98
+ ``` bash
98
99
$ htmlhint --config htmlhint.conf test.html
99
100
```
100
101
101
102
Custom rules:
102
103
103
- ```
104
+ ``` bash
104
105
$ htmlhint --rules tag-pair,id-class-value=underline index.html
105
106
```
106
107
0 commit comments