w3c-html-validator 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +1 -1
- package/README.md +1 -0
- package/bin/cli.js +4 -2
- package/dist/w3c-html-validator.d.ts +1 -1
- package/dist/w3c-html-validator.js +2 -2
- package/dist/w3c-html-validator.umd.cjs +2 -2
- package/package.json +7 -7
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2021-
|
|
3
|
+
Copyright (c) 2021-2023 Individual contributors to w3c-html-validator
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -52,6 +52,7 @@ Command-line flags:
|
|
|
52
52
|
| Flag | Description | Value |
|
|
53
53
|
| ------------ | --------------------------------------------------------------- | ---------- |
|
|
54
54
|
| `--continue` | Report messages but do not throw an error if validation failed. | N/A |
|
|
55
|
+
| `--delay` | Debounce pause in milliseconds between each file validation. | **number** |
|
|
55
56
|
| `--exclude` | Comma separated list of strings to match in paths to skip. | **string** |
|
|
56
57
|
| `--note` | Place to add a comment only for humans. | **string** |
|
|
57
58
|
| `--quiet` | Suppress messages for successful validations. | N/A |
|
package/bin/cli.js
CHANGED
|
@@ -28,9 +28,10 @@ import glob from 'glob';
|
|
|
28
28
|
import log from 'fancy-log';
|
|
29
29
|
|
|
30
30
|
// Parameters and flags
|
|
31
|
-
const validFlags = ['continue', 'exclude', 'note', 'quiet', 'trim'];
|
|
31
|
+
const validFlags = ['continue', 'delay', 'exclude', 'note', 'quiet', 'trim'];
|
|
32
32
|
const cli = cliArgvUtil.parse(validFlags);
|
|
33
33
|
const files = cli.params;
|
|
34
|
+
const delay = parseInt(cli.flagMap.delay) || 500; //default half second debounce pause
|
|
34
35
|
const trim = parseInt(cli.flagMap.trim) || null;
|
|
35
36
|
|
|
36
37
|
// Validator
|
|
@@ -56,4 +57,5 @@ const reporterOptions = {
|
|
|
56
57
|
maxMessageLen: trim,
|
|
57
58
|
};
|
|
58
59
|
const handleReport = (report) => w3cHtmlValidator.reporter(report, reporterOptions);
|
|
59
|
-
|
|
60
|
+
const getReport = (file) => w3cHtmlValidator.validate({ filename: file }).then(handleReport);
|
|
61
|
+
filenames.forEach((file, i) => globalThis.setTimeout(() => getReport(file), i * delay));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
//! w3c-html-validator v1.3.
|
|
1
|
+
//! w3c-html-validator v1.3.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
|
const w3cHtmlValidator = {
|
|
8
|
-
version: '1.3.
|
|
8
|
+
version: '1.3.1',
|
|
9
9
|
validate(options) {
|
|
10
10
|
var _a;
|
|
11
11
|
const defaults = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! w3c-html-validator v1.3.
|
|
1
|
+
//! w3c-html-validator v1.3.1 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
|
|
2
2
|
|
|
3
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -20,7 +20,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
const fancy_log_1 = __importDefault(require("fancy-log"));
|
|
21
21
|
const superagent_1 = __importDefault(require("superagent"));
|
|
22
22
|
const w3cHtmlValidator = {
|
|
23
|
-
version: '1.3.
|
|
23
|
+
version: '1.3.1',
|
|
24
24
|
validate(options) {
|
|
25
25
|
var _a;
|
|
26
26
|
const defaults = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "w3c-html-validator",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Check the markup validity of HTML files using the W3C validator",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -81,25 +81,25 @@
|
|
|
81
81
|
"chalk": "~5.2",
|
|
82
82
|
"cli-argv-util": "~0.1",
|
|
83
83
|
"fancy-log": "~2.0",
|
|
84
|
-
"glob": "~8.
|
|
84
|
+
"glob": "~8.1",
|
|
85
85
|
"superagent": "~8.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@types/fancy-log": "~2.0",
|
|
89
89
|
"@types/glob": "~8.0",
|
|
90
|
-
"@types/node": "~18.
|
|
90
|
+
"@types/node": "~18.13",
|
|
91
91
|
"@types/superagent": "~4.1",
|
|
92
|
-
"@typescript-eslint/eslint-plugin": "~5.
|
|
93
|
-
"@typescript-eslint/parser": "~5.
|
|
92
|
+
"@typescript-eslint/eslint-plugin": "~5.51",
|
|
93
|
+
"@typescript-eslint/parser": "~5.51",
|
|
94
94
|
"add-dist-header": "~0.3",
|
|
95
95
|
"assert-deep-strict-equal": "~1.0",
|
|
96
96
|
"copy-file-util": "~0.1",
|
|
97
97
|
"copy-folder-util": "~0.2",
|
|
98
|
-
"eslint": "~8.
|
|
98
|
+
"eslint": "~8.33",
|
|
99
99
|
"jshint": "~2.13",
|
|
100
100
|
"merge-stream": "~2.0",
|
|
101
101
|
"mocha": "~10.2",
|
|
102
|
-
"rimraf": "
|
|
102
|
+
"rimraf": "3",
|
|
103
103
|
"run-scripts-util": "~0.1",
|
|
104
104
|
"typescript": "~4.9"
|
|
105
105
|
}
|