You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-17Lines changed: 19 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,17 +29,17 @@ gulp.src("./src/*.html")
29
29
#### options
30
30
See all rules here: [https://github.com/HTMLHint/HTMLHint/wiki/Rules](https://github.com/yaniswang/HTMLHint/wiki/Rules)
31
31
32
-
If options is empty, task use standard options.
32
+
If `options` is empty, the task will use standard options.
33
33
34
34
##### options.htmlhintrc
35
-
Type: `String`
35
+
Type: `String`<br>
36
36
Default value: `null`
37
37
38
38
If this filename is specified, options and globals defined there will be used. Task and target options override the options within the `htmlhintrc` file. The `htmlhintrc` file must be valid JSON and looks something like this:
39
39
40
40
```json
41
41
{
42
-
"tag-pair": true,
42
+
"tag-pair": true
43
43
}
44
44
```
45
45
@@ -52,11 +52,11 @@ gulp.src("./src/*.html")
52
52
53
53
#### customRules
54
54
55
-
Type: `Array`_Optional_
55
+
Type: `Array`_Optional_<br>
56
56
Default value: `null`
57
57
58
-
Array that contains all userdefined custom rules. Adding a custom rule with this param doesn't require to add it's id in the `htmlhintrc` file.
59
-
All defined custom rules inside this array should be a valid object and looks like this:
58
+
Array that contains all user-defined custom rules. Rules added to this param need not exist in the `htmlhintrc` file.
59
+
All rules inside this array should be valid objects and look like this:
60
60
61
61
```javascript
62
62
{
@@ -86,12 +86,12 @@ gulp.src("./src/*.html")
86
86
.pipe(htmlhint('.htmlhintrc', customRules))
87
87
```
88
88
89
-
Note: You can call `htmlhint` function with 4 ways:
89
+
Note: You can call `htmlhint` function four different ways:
90
90
91
-
- Without params (task use standard options).
91
+
- Without params (task will use standard options).
92
92
- With `options` param alone.
93
93
- With `customRules` param alone (task will only use custom rules options).
94
-
- With `options` and `customRules` params defined.
94
+
- With both `options` and `customRules` params defined.
95
95
96
96
## Reporters
97
97
@@ -105,11 +105,11 @@ gulp.src("./src/*.html")
105
105
```
106
106
107
107
108
-
### Fail reporter
108
+
### Fail reporters
109
109
110
110
#### failOnError
111
111
112
-
Use this reporter if you want your task to fail in case of a HTMLHint Error (fails on first file).
112
+
Use this reporter if you want your task to fail on the first file that triggers an HTMLHint Error.
113
113
It also prints a summary of all errors in the first bad file.
114
114
115
115
```javascript
@@ -122,7 +122,7 @@ gulp.src("./src/*.html")
122
122
123
123
#### failAfterError
124
124
125
-
Use this reporter if you want your task to fail in case of a HTMLHint Error (collects statistics from all files and then fails).
125
+
Use this reporter if you want to collect statistics from all files before failing.
126
126
It also prints a summary of all errors in the first bad file.
127
127
128
128
```javascript
@@ -133,13 +133,15 @@ gulp.src("./src/*.html")
133
133
.pipe(htmlhint.failAfterError())
134
134
```
135
135
136
-
Optionally, you can pass the a config object (works for both fail reporters)
136
+
#### Reporter options
137
137
138
-
__Plugin options:__
138
+
Optionally, you can pass a config object to either fail reporter.
139
139
140
-
-*suppress*
140
+
##### suppress
141
+
Type: `Boolean`<br>
142
+
Default value: `false`
141
143
142
-
When set to `true`, it does not display file errors on failure.
144
+
When set to `true`, errors are not displayed on failure.
143
145
Use in conjunction with the default and/or custom reporter(s).
144
146
Prevents duplication of error messages when used along with another reporter.
145
147
@@ -152,7 +154,7 @@ __Plugin options:__
152
154
.pipe(htmlhint.failOnError({ suppress:true }))
153
155
```
154
156
155
-
### Thirdparty reporter
157
+
### Third-party reporters
156
158
157
159
[gulp-reporter](https://github.com/gucong3000/gulp-reporter) used in team project, it fails only when error belongs to the current author of git.
0 commit comments