1
- //! w3c-html-validator v1.8.0 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
1
+ //! w3c-html-validator v1.8.1 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
2
2
3
3
import chalk from 'chalk' ;
4
4
import fs from 'fs' ;
5
5
import log from 'fancy-log' ;
6
6
import request from 'superagent' ;
7
7
import slash from 'slash' ;
8
8
const w3cHtmlValidator = {
9
- version : '1.8.0 ' ,
9
+ version : '1.8.1 ' ,
10
10
validate ( options ) {
11
11
const defaults = {
12
12
checkUrl : 'https://validator.w3.org/nu/' ,
13
+ dryRun : false ,
13
14
ignoreLevel : null ,
14
15
ignoreMessages : [ ] ,
15
16
output : 'json' ,
16
- skip : false ,
17
17
} ;
18
18
const settings = { ...defaults , ...options } ;
19
19
if ( ! settings . html && ! settings . filename && ! settings . website )
@@ -61,7 +61,7 @@ const w3cHtmlValidator = {
61
61
status : response . statusCode || - 1 ,
62
62
messages : json ? response . body . messages : null ,
63
63
display : json ? null : response . text ,
64
- skip : settings . skip ,
64
+ dryRun : settings . dryRun ,
65
65
} ) ;
66
66
const handleError = ( reason ) => {
67
67
const errRes = reason . response ?? { } ;
@@ -73,14 +73,14 @@ const w3cHtmlValidator = {
73
73
const pseudoResponse = {
74
74
statusCode : 200 ,
75
75
body : { messages : [ ] } ,
76
- text : 'Validation skipped .' ,
76
+ text : 'Validation bypassed .' ,
77
77
} ;
78
78
const pseudoRequest = ( ) => new Promise ( resolve => resolve ( pseudoResponse ) ) ;
79
- const validation = settings . skip ? pseudoRequest ( ) : w3cRequest ;
79
+ const validation = settings . dryRun ? pseudoRequest ( ) : w3cRequest ;
80
80
return validation . then ( filterMessages ) . then ( toValidatorResults ) . catch ( handleError ) ;
81
81
} ,
82
- skipNotice ( ) {
83
- log ( chalk . gray ( 'w3c-html-validator' ) , chalk . yellowBright ( 'skip mode:' ) , chalk . whiteBright ( 'validation being bypassed' ) ) ;
82
+ dryRunNotice ( ) {
83
+ log ( chalk . gray ( 'w3c-html-validator' ) , chalk . yellowBright ( 'dry run mode:' ) , chalk . whiteBright ( 'validation being bypassed' ) ) ;
84
84
} ,
85
85
summary ( numFiles ) {
86
86
log ( chalk . gray ( 'w3c-html-validator' ) , chalk . magenta ( 'files: ' + numFiles ) ) ;
0 commit comments