html-validate 7.13.3 → 7.15.0
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/browser.d.ts +1 -0
- package/browser.js +1 -0
- package/dist/cjs/browser.d.ts +1 -4
- package/dist/cjs/browser.js +13 -1
- package/dist/cjs/browser.js.map +1 -1
- package/dist/cjs/cli.js +17 -9
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core.js +160 -118
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +1 -1
- package/dist/cjs/html-validate.js +1 -1
- package/dist/cjs/index.d.ts +1 -89
- package/dist/cjs/index.js +13 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/jest-lib.js +17 -12
- package/dist/cjs/jest-lib.js.map +1 -1
- package/dist/cjs/jest.d.ts +1 -42
- package/dist/cjs/jest.js.map +1 -1
- package/dist/cjs/meta-helper.js +3 -0
- package/dist/cjs/meta-helper.js.map +1 -1
- package/dist/cjs/rules-helper.js +3 -3
- package/dist/cjs/rules-helper.js.map +1 -1
- package/dist/cjs/test-utils.d.ts +1 -30
- package/dist/cjs/test-utils.js +3 -0
- package/dist/cjs/test-utils.js.map +1 -1
- package/dist/cjs/tsdoc-metadata.json +11 -0
- package/dist/es/browser.d.ts +1 -4
- package/dist/es/browser.js +2 -2
- package/dist/es/cli.js +17 -8
- package/dist/es/cli.js.map +1 -1
- package/dist/es/core.js +139 -101
- package/dist/es/core.js.map +1 -1
- package/dist/es/elements.js +1 -1
- package/dist/es/html-validate.js +2 -2
- package/dist/es/index.d.ts +1 -89
- package/dist/es/index.js +2 -2
- package/dist/es/jest-lib.js +18 -13
- package/dist/es/jest-lib.js.map +1 -1
- package/dist/es/jest.d.ts +1 -42
- package/dist/es/jest.js.map +1 -1
- package/dist/es/meta-helper.js +3 -0
- package/dist/es/meta-helper.js.map +1 -1
- package/dist/es/rules-helper.js +4 -4
- package/dist/es/rules-helper.js.map +1 -1
- package/dist/es/test-utils.d.ts +1 -30
- package/dist/es/test-utils.js +3 -0
- package/dist/es/test-utils.js.map +1 -1
- package/dist/{es/core.d.ts → types/browser.d.ts} +2312 -2615
- package/dist/{cjs/core.d.ts → types/index.d.ts} +2505 -2615
- package/dist/types/jest.d.ts +44 -0
- package/dist/types/test-utils.d.ts +817 -0
- package/jest.d.ts +1 -2
- package/package.json +38 -32
- package/test-utils.d.ts +1 -2
- package/dist/cjs/meta-helper.d.ts +0 -28
- package/dist/cjs/rules-helper.d.ts +0 -54
- package/dist/es/meta-helper.d.ts +0 -28
- package/dist/es/rules-helper.d.ts +0 -54
package/jest.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./dist/cjs/jest";
|
|
1
|
+
export * from "./dist/types/jest";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "html-validate",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.15.0",
|
|
4
4
|
"description": "Offline html5 validator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"html",
|
|
@@ -25,19 +25,29 @@
|
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
27
27
|
"require": "./dist/cjs/index.js",
|
|
28
|
-
"import": "./dist/es/index.js"
|
|
28
|
+
"import": "./dist/es/index.js",
|
|
29
|
+
"types": "./dist/types/index.d.ts"
|
|
29
30
|
},
|
|
30
31
|
"./browser": {
|
|
31
32
|
"require": "./dist/cjs/browser.js",
|
|
32
|
-
"import": "./dist/es/browser.js"
|
|
33
|
+
"import": "./dist/es/browser.js",
|
|
34
|
+
"types": "./dist/types/browser.d.ts"
|
|
33
35
|
},
|
|
34
36
|
"./dist/cjs/*": "./dist/cjs/*",
|
|
35
37
|
"./dist/es/*": "./dist/es/*",
|
|
36
38
|
"./dist/schema/*": "./dist/schema/*",
|
|
37
39
|
"./elements/*": "./elements/*",
|
|
38
|
-
"./jest":
|
|
40
|
+
"./jest": {
|
|
41
|
+
"require": "./dist/cjs/jest.js",
|
|
42
|
+
"import": "./dist/es/jest.js",
|
|
43
|
+
"types": "./dist/types/jest.d.ts"
|
|
44
|
+
},
|
|
39
45
|
"./package.json": "./package.json",
|
|
40
|
-
"./test-utils":
|
|
46
|
+
"./test-utils": {
|
|
47
|
+
"require": "./dist/cjs/test-utils.js",
|
|
48
|
+
"import": "./dist/es/test-utils.js",
|
|
49
|
+
"types": "./dist/types/test-utils.d.ts"
|
|
50
|
+
}
|
|
41
51
|
},
|
|
42
52
|
"main": "dist/cjs/index.js",
|
|
43
53
|
"module": "dist/es/index.js",
|
|
@@ -51,23 +61,19 @@
|
|
|
51
61
|
"elements",
|
|
52
62
|
"browser.{js,d.ts}",
|
|
53
63
|
"jest.{js,d.ts}",
|
|
54
|
-
"test-utils.{js,d.ts}"
|
|
55
|
-
"!dist/types/**",
|
|
56
|
-
"!tsconfig.json",
|
|
57
|
-
"!**/*.snap",
|
|
58
|
-
"!**/*.spec.{js,ts,d.ts}"
|
|
64
|
+
"test-utils.{js,d.ts}"
|
|
59
65
|
],
|
|
60
66
|
"workspaces": [
|
|
61
67
|
"docs"
|
|
62
68
|
],
|
|
63
69
|
"scripts": {
|
|
64
70
|
"prebuild": "run-s codegen prebuild:*",
|
|
65
|
-
"build": "run-s build
|
|
71
|
+
"build": "run-s build:cjs build:esm build:script",
|
|
66
72
|
"postbuild": "bash scripts/pkg",
|
|
67
73
|
"prebuild:tsc": "tsc",
|
|
68
74
|
"build:cjs": "rollup --config rollup.cjs.config.mjs",
|
|
69
|
-
"build:dts": "rollup --config rollup.dts.config.mjs",
|
|
70
75
|
"build:esm": "rollup --config rollup.esm.config.mjs",
|
|
76
|
+
"build:script": "node build.mjs",
|
|
71
77
|
"clean": "rm -rf dist public",
|
|
72
78
|
"codegen": "node scripts/codegen",
|
|
73
79
|
"compatibility": "scripts/compatibility.sh",
|
|
@@ -157,7 +163,7 @@
|
|
|
157
163
|
"ajv": "^8.0.0",
|
|
158
164
|
"deepmerge": "^4.2.0",
|
|
159
165
|
"espree": "^9.0.0",
|
|
160
|
-
"glob": "^
|
|
166
|
+
"glob": "^9.0.0",
|
|
161
167
|
"ignore": "^5.0.0",
|
|
162
168
|
"kleur": "^4.1.0",
|
|
163
169
|
"minimist": "^1.2.0",
|
|
@@ -165,43 +171,43 @@
|
|
|
165
171
|
"semver": "^7.0.0"
|
|
166
172
|
},
|
|
167
173
|
"devDependencies": {
|
|
168
|
-
"@html-validate/commitlint-config": "3.0.
|
|
169
|
-
"@html-validate/eslint-config": "5.
|
|
170
|
-
"@html-validate/eslint-config-jest": "5.
|
|
171
|
-
"@html-validate/eslint-config-typescript": "5.
|
|
172
|
-
"@html-validate/eslint-config-typescript-typeinfo": "5.
|
|
173
|
-
"@html-validate/jest-config": "3.6.
|
|
174
|
-
"@html-validate/prettier-config": "2.3.
|
|
175
|
-
"@html-validate/release-scripts": "4.0.
|
|
174
|
+
"@html-validate/commitlint-config": "3.0.13",
|
|
175
|
+
"@html-validate/eslint-config": "5.7.3",
|
|
176
|
+
"@html-validate/eslint-config-jest": "5.7.0",
|
|
177
|
+
"@html-validate/eslint-config-typescript": "5.7.3",
|
|
178
|
+
"@html-validate/eslint-config-typescript-typeinfo": "5.7.0",
|
|
179
|
+
"@html-validate/jest-config": "3.6.3",
|
|
180
|
+
"@html-validate/prettier-config": "2.3.9",
|
|
181
|
+
"@html-validate/release-scripts": "4.0.6",
|
|
182
|
+
"@microsoft/api-extractor": "7.34.4",
|
|
176
183
|
"@rollup/plugin-json": "6.0.0",
|
|
177
|
-
"@rollup/plugin-node-resolve": "15.0.
|
|
184
|
+
"@rollup/plugin-node-resolve": "15.0.2",
|
|
178
185
|
"@rollup/plugin-replace": "5.0.2",
|
|
179
|
-
"@rollup/plugin-typescript": "11.
|
|
186
|
+
"@rollup/plugin-typescript": "11.1.0",
|
|
180
187
|
"@rollup/plugin-virtual": "3.0.1",
|
|
181
188
|
"@types/babar": "0.2.1",
|
|
182
189
|
"@types/babel__code-frame": "7.0.3",
|
|
183
190
|
"@types/estree": "1.0.0",
|
|
184
|
-
"@types/
|
|
185
|
-
"@types/jest": "29.4.0",
|
|
191
|
+
"@types/jest": "29.5.0",
|
|
186
192
|
"@types/minimist": "1.2.2",
|
|
187
|
-
"@types/node": "14.18.
|
|
188
|
-
"@types/prompts": "2.4.
|
|
193
|
+
"@types/node": "14.18.42",
|
|
194
|
+
"@types/prompts": "2.4.4",
|
|
189
195
|
"@types/semver": "7.3.13",
|
|
190
196
|
"@types/stream-buffers": "3.0.4",
|
|
191
197
|
"babar": "0.2.3",
|
|
192
198
|
"husky": "8.0.3",
|
|
199
|
+
"is-ci": "3.0.1",
|
|
193
200
|
"jest": "29.5.0",
|
|
194
201
|
"jest-diff": "29.5.0",
|
|
195
202
|
"jest-environment-jsdom": "29.5.0",
|
|
196
203
|
"jest-snapshot": "29.5.0",
|
|
204
|
+
"memfs": "3.5.0",
|
|
197
205
|
"npm-pkg-lint": "1.11.2",
|
|
198
206
|
"npm-run-all": "4.1.5",
|
|
199
|
-
"rollup": "3.
|
|
200
|
-
"rollup-plugin-copy": "3.4.0",
|
|
201
|
-
"rollup-plugin-dts": "5.2.0",
|
|
207
|
+
"rollup": "3.20.2",
|
|
202
208
|
"stream-buffers": "3.0.2",
|
|
203
|
-
"ts-jest": "29.0
|
|
204
|
-
"typescript": "
|
|
209
|
+
"ts-jest": "29.1.0",
|
|
210
|
+
"typescript": "5.0.4"
|
|
205
211
|
},
|
|
206
212
|
"peerDependencies": {
|
|
207
213
|
"jest": "^25.1 || ^26 || ^27.1 || ^28.1.3 || ^29.0.3",
|
package/test-utils.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./dist/cjs/test-utils";
|
|
1
|
+
export * from "./dist/types/test-utils";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { k as MetaDataTable, n as MetaAttributeAllowedCallback } from './core.js';
|
|
2
|
-
import './rules-helper.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Helper function to assist IDE with completion and type-checking.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
declare function defineMetadata(metatable: MetaDataTable): MetaDataTable;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Helpers when writing element metadata.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
interface MetadataHelper {
|
|
17
|
-
/** Returns an error if another attribute is omitted, i.e. it requires another attribute to be present to pass. */
|
|
18
|
-
allowedIfAttributeIsPresent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
|
|
19
|
-
/** Returns an error if another attribute is present, i.e. it requires another attribute to be omitted to pass. */
|
|
20
|
-
allowedIfAttributeIsAbsent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
|
|
21
|
-
/** Returns an error if another attribute does not have one of the listed values */
|
|
22
|
-
allowedIfAttributeHasValue(this: void, attr: string, value: string[], options?: {
|
|
23
|
-
defaultValue?: string | null;
|
|
24
|
-
}): MetaAttributeAllowedCallback;
|
|
25
|
-
}
|
|
26
|
-
declare const metadataHelper: MetadataHelper;
|
|
27
|
-
|
|
28
|
-
export { defineMetadata as d, metadataHelper as m };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { f as HtmlElement } from './core.js';
|
|
2
|
-
|
|
3
|
-
interface IncludeExcludeOptions {
|
|
4
|
-
include: string[] | null;
|
|
5
|
-
exclude: string[] | null;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
declare function keywordPatternMatcher(list: string[], keyword: string): boolean;
|
|
11
|
-
|
|
12
|
-
declare const HTML_CACHE_KEY: unique symbol;
|
|
13
|
-
declare const A11Y_CACHE_KEY: unique symbol;
|
|
14
|
-
declare const IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY: unique symbol;
|
|
15
|
-
declare const IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY: unique symbol;
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
declare enum TextClassification {
|
|
20
|
-
EMPTY_TEXT = 0,
|
|
21
|
-
DYNAMIC_TEXT = 1,
|
|
22
|
-
STATIC_TEXT = 2
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
interface TextClassificationOptions {
|
|
28
|
-
/** If `true` only accessible text is considered (default false) */
|
|
29
|
-
accessible?: boolean;
|
|
30
|
-
/** If `true` the `hidden` and `aria-hidden` attribute is ignored on the root
|
|
31
|
-
* (and parents) elements (default false) */
|
|
32
|
-
ignoreHiddenRoot?: boolean;
|
|
33
|
-
}
|
|
34
|
-
declare module "../../dom/cache" {
|
|
35
|
-
interface DOMNodeCache {
|
|
36
|
-
[HTML_CACHE_KEY]: TextClassification;
|
|
37
|
-
[A11Y_CACHE_KEY]: TextClassification;
|
|
38
|
-
[IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY]: TextClassification;
|
|
39
|
-
[IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY]: TextClassification;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Checks text content of an element.
|
|
44
|
-
*
|
|
45
|
-
* Any text is considered including text from descendant elements. Whitespace is
|
|
46
|
-
* ignored.
|
|
47
|
-
*
|
|
48
|
-
* If any text is dynamic `TextClassification.DYNAMIC_TEXT` is returned.
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
declare function classifyNodeText(node: HtmlElement, options?: TextClassificationOptions): TextClassification;
|
|
53
|
-
|
|
54
|
-
export { IncludeExcludeOptions as I, TextClassification as T, classifyNodeText as c, keywordPatternMatcher as k };
|
package/dist/es/meta-helper.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { k as MetaDataTable, n as MetaAttributeAllowedCallback } from './core.js';
|
|
2
|
-
import './rules-helper.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Helper function to assist IDE with completion and type-checking.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
declare function defineMetadata(metatable: MetaDataTable): MetaDataTable;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Helpers when writing element metadata.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
interface MetadataHelper {
|
|
17
|
-
/** Returns an error if another attribute is omitted, i.e. it requires another attribute to be present to pass. */
|
|
18
|
-
allowedIfAttributeIsPresent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
|
|
19
|
-
/** Returns an error if another attribute is present, i.e. it requires another attribute to be omitted to pass. */
|
|
20
|
-
allowedIfAttributeIsAbsent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
|
|
21
|
-
/** Returns an error if another attribute does not have one of the listed values */
|
|
22
|
-
allowedIfAttributeHasValue(this: void, attr: string, value: string[], options?: {
|
|
23
|
-
defaultValue?: string | null;
|
|
24
|
-
}): MetaAttributeAllowedCallback;
|
|
25
|
-
}
|
|
26
|
-
declare const metadataHelper: MetadataHelper;
|
|
27
|
-
|
|
28
|
-
export { defineMetadata as d, metadataHelper as m };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { f as HtmlElement } from './core.js';
|
|
2
|
-
|
|
3
|
-
interface IncludeExcludeOptions {
|
|
4
|
-
include: string[] | null;
|
|
5
|
-
exclude: string[] | null;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
declare function keywordPatternMatcher(list: string[], keyword: string): boolean;
|
|
11
|
-
|
|
12
|
-
declare const HTML_CACHE_KEY: unique symbol;
|
|
13
|
-
declare const A11Y_CACHE_KEY: unique symbol;
|
|
14
|
-
declare const IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY: unique symbol;
|
|
15
|
-
declare const IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY: unique symbol;
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
declare enum TextClassification {
|
|
20
|
-
EMPTY_TEXT = 0,
|
|
21
|
-
DYNAMIC_TEXT = 1,
|
|
22
|
-
STATIC_TEXT = 2
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
interface TextClassificationOptions {
|
|
28
|
-
/** If `true` only accessible text is considered (default false) */
|
|
29
|
-
accessible?: boolean;
|
|
30
|
-
/** If `true` the `hidden` and `aria-hidden` attribute is ignored on the root
|
|
31
|
-
* (and parents) elements (default false) */
|
|
32
|
-
ignoreHiddenRoot?: boolean;
|
|
33
|
-
}
|
|
34
|
-
declare module "../../dom/cache" {
|
|
35
|
-
interface DOMNodeCache {
|
|
36
|
-
[HTML_CACHE_KEY]: TextClassification;
|
|
37
|
-
[A11Y_CACHE_KEY]: TextClassification;
|
|
38
|
-
[IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY]: TextClassification;
|
|
39
|
-
[IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY]: TextClassification;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Checks text content of an element.
|
|
44
|
-
*
|
|
45
|
-
* Any text is considered including text from descendant elements. Whitespace is
|
|
46
|
-
* ignored.
|
|
47
|
-
*
|
|
48
|
-
* If any text is dynamic `TextClassification.DYNAMIC_TEXT` is returned.
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
declare function classifyNodeText(node: HtmlElement, options?: TextClassificationOptions): TextClassification;
|
|
53
|
-
|
|
54
|
-
export { IncludeExcludeOptions as I, TextClassification as T, classifyNodeText as c, keywordPatternMatcher as k };
|