html-validate 11.3.0 → 11.5.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/dist/cjs/cli.js +7 -0
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core-nodejs.js +212 -2
- package/dist/cjs/core-nodejs.js.map +1 -1
- package/dist/cjs/core.js +161 -36
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +531 -50
- package/dist/cjs/elements.js.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/presets.d.ts +1 -0
- package/dist/cjs/presets.js +22 -0
- package/dist/cjs/presets.js.map +1 -0
- package/dist/esm/browser.js +1 -1
- package/dist/esm/cli.js +9 -2
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/core-browser.js +1 -1
- package/dist/esm/core-nodejs.js +212 -4
- package/dist/esm/core-nodejs.js.map +1 -1
- package/dist/esm/core.js +155 -37
- package/dist/esm/core.js.map +1 -1
- package/dist/esm/elements.js +531 -50
- package/dist/esm/elements.js.map +1 -1
- package/dist/esm/html-validate.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/jest-matchers.js +1 -1
- package/dist/esm/jest-utils.js +1 -1
- package/dist/esm/presets.d.ts +1 -0
- package/dist/esm/presets.js +11 -0
- package/dist/esm/presets.js.map +1 -0
- package/dist/esm/vitest-matchers.js +1 -1
- package/dist/esm/vitest-utils.js +1 -1
- package/dist/schema/elements.json +19 -1
- package/dist/types/browser.d.ts +98 -4
- package/dist/types/index.d.ts +164 -4
- package/dist/types/presets.d.ts +8 -0
- package/package.json +7 -2
|
@@ -2,7 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { parseArgs } from 'node:util';
|
|
4
4
|
import kleur from 'kleur';
|
|
5
|
-
import {
|
|
5
|
+
import { $ as name, aa as version, S as SchemaValidationError, Y as isUserError, q as bugs } from './core.js';
|
|
6
6
|
import { M as Mode, m as modeToFlag, C as CLI, a as haveImportMetaResolve, I as ImportResolveMissingError, d as dump, p as printConfig, i as init, l as lint, h as handleSchemaValidationError } from './cli.js';
|
|
7
7
|
import 'ajv';
|
|
8
8
|
import './elements.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { F as FileSystemConfigLoader, H as HtmlValidate, c as cjsResolver,
|
|
2
|
-
export { A as Attribute, C as Config, a as ConfigError, b as ConfigLoader, D as DOMNode, c as DOMTokenList, d as DOMTree, e as DynamicValue, f as EventHandler, H as HtmlElement, M as MetaCopyableProperty, g as MetaTable, N as NestedError, h as Node, P as Parser, i as PerformanceTracker, R as Reporter, j as ResolvedConfig, k as Rule, S as SchemaValidationError, l as Severity, m as StaticConfigLoader, T as TextClassification, n as TextContent, o as TextNode, U as UserError, W as WrappedError, p as ariaNaming, r as classifyNodeText,
|
|
1
|
+
export { F as FileSystemConfigLoader, a as FlatConfigLoader, H as HtmlValidate, c as cjsResolver, b as compatibilityCheck, d as defineFlatConfig, e as esmResolver } from './core-nodejs.js';
|
|
2
|
+
export { A as Attribute, C as Config, a as ConfigError, b as ConfigLoader, D as DOMNode, c as DOMTokenList, d as DOMTree, e as DynamicValue, f as EventHandler, H as HtmlElement, M as MetaCopyableProperty, g as MetaTable, N as NestedError, h as Node, P as Parser, i as PerformanceTracker, R as Reporter, j as ResolvedConfig, k as Rule, S as SchemaValidationError, l as Severity, m as StaticConfigLoader, T as TextClassification, n as TextContent, o as TextNode, U as UserError, W as WrappedError, p as ariaNaming, r as classifyNodeText, a2 as configPresets, G as defineConfig, I as definePlugin, O as formatterFactory, Y as isUserError, _ as keywordPatternMatcher, a3 as ruleExists, a4 as sliceLocation, a5 as staticResolver, aa as version, ac as walk } from './core.js';
|
|
3
3
|
export { C as CLI } from './cli.js';
|
|
4
4
|
export { d as defineMetadata, m as metadataHelper } from './meta-helper.js';
|
|
5
5
|
import 'node:fs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as diverge, a as createSyncFn, c as codeframe, i as isThenable } from './jest-utils.js';
|
|
2
|
-
import {
|
|
2
|
+
import { F as deepmerge, Z as jestWorkerPath } from './core.js';
|
|
3
3
|
import { toMatchSnapshot, toMatchInlineSnapshot } from 'jest-snapshot';
|
|
4
4
|
|
|
5
5
|
function createMatcher$6() {
|
package/dist/esm/jest-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as codeFrameColumns,
|
|
1
|
+
import { s as codeFrameColumns, L as getEndLocation, Q as getStartLocation } from './core.js';
|
|
2
2
|
import { MessageChannel, Worker, receiveMessageOnPort } from 'node:worker_threads';
|
|
3
3
|
import { l as legacyRequire } from './core-nodejs.js';
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../types/presets";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { u as a11y, v as browser, w as document, x as prettier, y as recommended, z as standard } from './core.js';
|
|
2
|
+
import 'ajv';
|
|
3
|
+
import './elements.js';
|
|
4
|
+
import './meta-helper.js';
|
|
5
|
+
import './utils/natural-join.js';
|
|
6
|
+
import './utils/parse-image-candidate-string.js';
|
|
7
|
+
import '@sidvind/better-ajv-errors';
|
|
8
|
+
import 'kleur';
|
|
9
|
+
import '@html-validate/stylish';
|
|
10
|
+
import 'semver';
|
|
11
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as diverge, a as createSyncFn, c as codeframe } from './vitest-utils.js';
|
|
2
|
-
import {
|
|
2
|
+
import { F as deepmerge, ab as vitestWorkerPath } from './core.js';
|
|
3
3
|
import * as vitest from 'vitest';
|
|
4
4
|
import { H as HtmlValidate } from './core-nodejs.js';
|
|
5
5
|
|
package/dist/esm/vitest-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as codeFrameColumns,
|
|
1
|
+
import { s as codeFrameColumns, L as getEndLocation, Q as getStartLocation } from './core.js';
|
|
2
2
|
import { MessageChannel, Worker, receiveMessageOnPort } from 'node:worker_threads';
|
|
3
3
|
import { l as legacyRequire } from './core-nodejs.js';
|
|
4
4
|
|
|
@@ -344,13 +344,31 @@
|
|
|
344
344
|
"title": "Exhaustive list of values (string or regex) this attribute accepts",
|
|
345
345
|
"uniqueItems": true,
|
|
346
346
|
"items": {
|
|
347
|
-
"anyOf": [
|
|
347
|
+
"anyOf": [
|
|
348
|
+
{ "type": "string" },
|
|
349
|
+
{ "regexp": true },
|
|
350
|
+
{
|
|
351
|
+
"type": "object",
|
|
352
|
+
"title": "Named regular expression",
|
|
353
|
+
"required": ["name", "pattern"],
|
|
354
|
+
"additionalProperties": false,
|
|
355
|
+
"properties": {
|
|
356
|
+
"name": { "type": "string", "minLength": 1 },
|
|
357
|
+
"pattern": { "anyOf": [{ "type": "string" }, { "regexp": true }] }
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
]
|
|
348
361
|
}
|
|
349
362
|
},
|
|
350
363
|
"omit": {
|
|
351
364
|
"type": "boolean",
|
|
352
365
|
"title": "Set to true if this attribute can optionally omit its value"
|
|
353
366
|
},
|
|
367
|
+
"reference": {
|
|
368
|
+
"type": "string",
|
|
369
|
+
"enum": ["id"],
|
|
370
|
+
"title": "Set when the attribute references another element."
|
|
371
|
+
},
|
|
354
372
|
"required": {
|
|
355
373
|
"title": "Set to true or a function to evaluate if this attribute is required",
|
|
356
374
|
"oneOf": [{ "type": "boolean" }, { "function": true }]
|
package/dist/types/browser.d.ts
CHANGED
|
@@ -341,6 +341,10 @@ export declare abstract class ConfigLoader {
|
|
|
341
341
|
*
|
|
342
342
|
* If [[configOverride]] is set it is merged with the final result.
|
|
343
343
|
*
|
|
344
|
+
* Do note that if `configOverride` is changed between calls the cache must be
|
|
345
|
+
* flushed in-between or the final results may vary. Loaders may cache the
|
|
346
|
+
* merged result.
|
|
347
|
+
*
|
|
344
348
|
* @param handle - Unique handle to get configuration for.
|
|
345
349
|
* @param configOverride - Optional configuration to merge final results with.
|
|
346
350
|
*/
|
|
@@ -744,6 +748,64 @@ export declare class EventHandler {
|
|
|
744
748
|
|
|
745
749
|
/* Excluded from this release type: EventPerformanceEntry */
|
|
746
750
|
|
|
751
|
+
/**
|
|
752
|
+
* @public
|
|
753
|
+
* @since 11.5.0
|
|
754
|
+
*/
|
|
755
|
+
export declare type FlatConfig = FlatConfigObject[];
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* A single object in a flat configuration file.
|
|
759
|
+
*
|
|
760
|
+
* @public
|
|
761
|
+
* @since 11.5.0
|
|
762
|
+
*/
|
|
763
|
+
export declare interface FlatConfigObject {
|
|
764
|
+
/**
|
|
765
|
+
* Optional name of this configuration object.
|
|
766
|
+
*
|
|
767
|
+
* Used for troubleshooting and error messages.
|
|
768
|
+
*/
|
|
769
|
+
name?: string;
|
|
770
|
+
/**
|
|
771
|
+
* An array of glob patterns indicating the files that the configuration
|
|
772
|
+
* object should apply to.
|
|
773
|
+
*
|
|
774
|
+
* If not specified, the configuration object applies to all files matched by
|
|
775
|
+
* any other configuration object.
|
|
776
|
+
*/
|
|
777
|
+
files?: string[];
|
|
778
|
+
/**
|
|
779
|
+
* An array of glob patterns indicating the files that the configuration object should not apply to.
|
|
780
|
+
*
|
|
781
|
+
* If not specified, the configuration object applies to all files matches by `files`.
|
|
782
|
+
*
|
|
783
|
+
* If `ignores` is used without any other keys in the configuration object,
|
|
784
|
+
* then the patterns act as a global ignores and gets applied to every
|
|
785
|
+
* configuration object.
|
|
786
|
+
*/
|
|
787
|
+
ignores?: string[];
|
|
788
|
+
/**
|
|
789
|
+
* Element metadata sources.
|
|
790
|
+
*/
|
|
791
|
+
elements?: MetaDataTable[];
|
|
792
|
+
/**
|
|
793
|
+
* Plugins
|
|
794
|
+
*/
|
|
795
|
+
plugins?: Plugin_2[];
|
|
796
|
+
/**
|
|
797
|
+
* Source file transformations.
|
|
798
|
+
*
|
|
799
|
+
* Maps a regular-expression pattern (matched against the filename) to a
|
|
800
|
+
* transformer function.
|
|
801
|
+
*/
|
|
802
|
+
transform?: Record<string, Transformer_2>;
|
|
803
|
+
/**
|
|
804
|
+
* Rule configuration.
|
|
805
|
+
*/
|
|
806
|
+
rules?: RuleConfig;
|
|
807
|
+
}
|
|
808
|
+
|
|
747
809
|
/**
|
|
748
810
|
* @public
|
|
749
811
|
*/
|
|
@@ -1462,10 +1524,19 @@ export declare interface MetaAttribute {
|
|
|
1462
1524
|
*/
|
|
1463
1525
|
deprecated?: boolean | string;
|
|
1464
1526
|
/**
|
|
1465
|
-
* If set it is an exhaustive list of all possible values
|
|
1466
|
-
*
|
|
1527
|
+
* If set it is an exhaustive list of all possible values this attribute can
|
|
1528
|
+
* have (each token if list is set).
|
|
1529
|
+
*
|
|
1530
|
+
* Each entry can either be:
|
|
1531
|
+
*
|
|
1532
|
+
* - A keyword (as string).
|
|
1533
|
+
* - A regular expression.
|
|
1534
|
+
* - An object with `name` and `pattern` (regular expression).
|
|
1535
|
+
*
|
|
1536
|
+
* When using an object the name is presented in error messages and contextual
|
|
1537
|
+
* documentation.
|
|
1467
1538
|
*/
|
|
1468
|
-
enum?: Array<string | RegExp>;
|
|
1539
|
+
enum?: Array<string | RegExp | MetaAttributeNamedRegex>;
|
|
1469
1540
|
/**
|
|
1470
1541
|
* If `true` this attribute contains space-separated tokens and each token must
|
|
1471
1542
|
* be valid by itself.
|
|
@@ -1475,6 +1546,16 @@ export declare interface MetaAttribute {
|
|
|
1475
1546
|
* If `true` this attribute can omit the value.
|
|
1476
1547
|
*/
|
|
1477
1548
|
omit?: boolean;
|
|
1549
|
+
/**
|
|
1550
|
+
* When set, this attribute references another element by the given type. If
|
|
1551
|
+
* `list` is also set, each individual token in the attribute value references another
|
|
1552
|
+
* element.
|
|
1553
|
+
*
|
|
1554
|
+
* - `id`: the attribute value references the id of another element in the document.
|
|
1555
|
+
*
|
|
1556
|
+
* @since 11.4.0
|
|
1557
|
+
*/
|
|
1558
|
+
reference?: "id";
|
|
1478
1559
|
/**
|
|
1479
1560
|
* If set this attribute is required to be present on the element.
|
|
1480
1561
|
*/
|
|
@@ -1492,6 +1573,19 @@ export declare interface MetaAttribute {
|
|
|
1492
1573
|
*/
|
|
1493
1574
|
export declare type MetaAttributeAllowedCallback = (node: HtmlElementLike, attr: string | DynamicValue | null | undefined) => string | null | undefined;
|
|
1494
1575
|
|
|
1576
|
+
/**
|
|
1577
|
+
* A named regular expression for use in attribute value validation.
|
|
1578
|
+
*
|
|
1579
|
+
* @public
|
|
1580
|
+
* @since 11.5.0
|
|
1581
|
+
*/
|
|
1582
|
+
export declare interface MetaAttributeNamedRegex {
|
|
1583
|
+
/** Human-readable label shown in error documentation. */
|
|
1584
|
+
name: string;
|
|
1585
|
+
/** Regular expression used for validation. */
|
|
1586
|
+
pattern: RegExp | string;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1495
1589
|
/**
|
|
1496
1590
|
* Callback for the `required` property of `MetaAttribute`.
|
|
1497
1591
|
*
|
|
@@ -2211,7 +2305,7 @@ export declare class ResolvedConfig {
|
|
|
2211
2305
|
* Returns the (merged) configuration data used to create this resolved
|
|
2212
2306
|
* configuration.
|
|
2213
2307
|
*/
|
|
2214
|
-
getConfigData(): ConfigData;
|
|
2308
|
+
getConfigData(): ConfigData | FlatConfig;
|
|
2215
2309
|
getMetaTable(): MetaTable;
|
|
2216
2310
|
getPlugins(): Plugin_2[];
|
|
2217
2311
|
getRules(): Map<string, [Severity, RuleOptions]>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -439,6 +439,10 @@ export declare abstract class ConfigLoader {
|
|
|
439
439
|
*
|
|
440
440
|
* If [[configOverride]] is set it is merged with the final result.
|
|
441
441
|
*
|
|
442
|
+
* Do note that if `configOverride` is changed between calls the cache must be
|
|
443
|
+
* flushed in-between or the final results may vary. Loaders may cache the
|
|
444
|
+
* merged result.
|
|
445
|
+
*
|
|
442
446
|
* @param handle - Unique handle to get configuration for.
|
|
443
447
|
* @param configOverride - Optional configuration to merge final results with.
|
|
444
448
|
*/
|
|
@@ -501,6 +505,27 @@ export declare interface DeferredMessage extends Omit<Message, "selector"> {
|
|
|
501
505
|
*/
|
|
502
506
|
export declare function defineConfig(config: ConfigData): ConfigData;
|
|
503
507
|
|
|
508
|
+
/**
|
|
509
|
+
* Helper function to assist IDE with completion and type-checking.
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
*
|
|
513
|
+
* ```ts
|
|
514
|
+
* import { defineFlatConfig } from "html-validate";
|
|
515
|
+
*
|
|
516
|
+
* export default defineFlatConfig([
|
|
517
|
+
* {
|
|
518
|
+
* files: ["*.html"],
|
|
519
|
+
* rules: { "void-style": "error" },
|
|
520
|
+
* }
|
|
521
|
+
* ]);
|
|
522
|
+
* ```
|
|
523
|
+
*
|
|
524
|
+
* @public
|
|
525
|
+
* @since 11.5.0
|
|
526
|
+
*/
|
|
527
|
+
export declare function defineFlatConfig(config: FlatConfig): FlatConfig;
|
|
528
|
+
|
|
504
529
|
/**
|
|
505
530
|
* Helper function to assist IDE with completion and type-checking.
|
|
506
531
|
*
|
|
@@ -954,6 +979,109 @@ export declare interface FileSystemConfigLoaderOptions {
|
|
|
954
979
|
fs: FSLike;
|
|
955
980
|
}
|
|
956
981
|
|
|
982
|
+
/**
|
|
983
|
+
* @public
|
|
984
|
+
* @since 11.5.0
|
|
985
|
+
*/
|
|
986
|
+
export declare type FlatConfig = FlatConfigObject[];
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* Configuration loader for the flat config format.
|
|
990
|
+
*
|
|
991
|
+
* Loads configuration from a `html-validate.config.*` file and applies
|
|
992
|
+
* per-file glob filtering.
|
|
993
|
+
*
|
|
994
|
+
* @public
|
|
995
|
+
* @since 11.5.0
|
|
996
|
+
*/
|
|
997
|
+
export declare class FlatConfigLoader extends ConfigLoader {
|
|
998
|
+
private readonly configFilePath;
|
|
999
|
+
private configCache;
|
|
1000
|
+
private fileCache;
|
|
1001
|
+
/**
|
|
1002
|
+
* @param configFilePath - Absolute path to the flat config file.
|
|
1003
|
+
* @param resolvers - Resolvers to use.
|
|
1004
|
+
*/
|
|
1005
|
+
constructor(configFilePath: string, resolvers?: Resolver[]);
|
|
1006
|
+
/**
|
|
1007
|
+
* Search `dir` and its ancestors for a flat config file and, if found,
|
|
1008
|
+
* return a new `FlatConfigLoader` pointed at it. Returns `null` when no
|
|
1009
|
+
* config file can be found.
|
|
1010
|
+
*
|
|
1011
|
+
* @param dir - Directory to start searching from.
|
|
1012
|
+
* @param resolvers - Resolvers to use.
|
|
1013
|
+
*/
|
|
1014
|
+
static fromDirectory(dir: string, resolvers?: Resolver[]): FlatConfigLoader | null;
|
|
1015
|
+
/**
|
|
1016
|
+
* Get configuration for the given filename.
|
|
1017
|
+
*
|
|
1018
|
+
* Do note that if `configOverride` is changed between calls the cache must be
|
|
1019
|
+
* flushed in-between. This loader caches the final merged result.
|
|
1020
|
+
*
|
|
1021
|
+
* @param filename - Absolute or relative path to the file being validated.
|
|
1022
|
+
* @param configOverride - Optional configuration to merge into the result.
|
|
1023
|
+
*/
|
|
1024
|
+
getConfigFor(filename: string, configOverride?: ConfigData): Promise<ResolvedConfig>;
|
|
1025
|
+
/**
|
|
1026
|
+
* Flush the cached flat config, forcing a reload on the next call.
|
|
1027
|
+
*/
|
|
1028
|
+
flushCache(handle?: string): void;
|
|
1029
|
+
protected defaultConfig(): Config;
|
|
1030
|
+
private loadConfig;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* A single object in a flat configuration file.
|
|
1035
|
+
*
|
|
1036
|
+
* @public
|
|
1037
|
+
* @since 11.5.0
|
|
1038
|
+
*/
|
|
1039
|
+
export declare interface FlatConfigObject {
|
|
1040
|
+
/**
|
|
1041
|
+
* Optional name of this configuration object.
|
|
1042
|
+
*
|
|
1043
|
+
* Used for troubleshooting and error messages.
|
|
1044
|
+
*/
|
|
1045
|
+
name?: string;
|
|
1046
|
+
/**
|
|
1047
|
+
* An array of glob patterns indicating the files that the configuration
|
|
1048
|
+
* object should apply to.
|
|
1049
|
+
*
|
|
1050
|
+
* If not specified, the configuration object applies to all files matched by
|
|
1051
|
+
* any other configuration object.
|
|
1052
|
+
*/
|
|
1053
|
+
files?: string[];
|
|
1054
|
+
/**
|
|
1055
|
+
* An array of glob patterns indicating the files that the configuration object should not apply to.
|
|
1056
|
+
*
|
|
1057
|
+
* If not specified, the configuration object applies to all files matches by `files`.
|
|
1058
|
+
*
|
|
1059
|
+
* If `ignores` is used without any other keys in the configuration object,
|
|
1060
|
+
* then the patterns act as a global ignores and gets applied to every
|
|
1061
|
+
* configuration object.
|
|
1062
|
+
*/
|
|
1063
|
+
ignores?: string[];
|
|
1064
|
+
/**
|
|
1065
|
+
* Element metadata sources.
|
|
1066
|
+
*/
|
|
1067
|
+
elements?: MetaDataTable[];
|
|
1068
|
+
/**
|
|
1069
|
+
* Plugins
|
|
1070
|
+
*/
|
|
1071
|
+
plugins?: Plugin_2[];
|
|
1072
|
+
/**
|
|
1073
|
+
* Source file transformations.
|
|
1074
|
+
*
|
|
1075
|
+
* Maps a regular-expression pattern (matched against the filename) to a
|
|
1076
|
+
* transformer function.
|
|
1077
|
+
*/
|
|
1078
|
+
transform?: Record<string, Transformer_2>;
|
|
1079
|
+
/**
|
|
1080
|
+
* Rule configuration.
|
|
1081
|
+
*/
|
|
1082
|
+
rules?: RuleConfig;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
957
1085
|
/**
|
|
958
1086
|
* @public
|
|
959
1087
|
*/
|
|
@@ -1705,10 +1833,19 @@ export declare interface MetaAttribute {
|
|
|
1705
1833
|
*/
|
|
1706
1834
|
deprecated?: boolean | string;
|
|
1707
1835
|
/**
|
|
1708
|
-
* If set it is an exhaustive list of all possible values
|
|
1709
|
-
*
|
|
1836
|
+
* If set it is an exhaustive list of all possible values this attribute can
|
|
1837
|
+
* have (each token if list is set).
|
|
1838
|
+
*
|
|
1839
|
+
* Each entry can either be:
|
|
1840
|
+
*
|
|
1841
|
+
* - A keyword (as string).
|
|
1842
|
+
* - A regular expression.
|
|
1843
|
+
* - An object with `name` and `pattern` (regular expression).
|
|
1844
|
+
*
|
|
1845
|
+
* When using an object the name is presented in error messages and contextual
|
|
1846
|
+
* documentation.
|
|
1710
1847
|
*/
|
|
1711
|
-
enum?: Array<string | RegExp>;
|
|
1848
|
+
enum?: Array<string | RegExp | MetaAttributeNamedRegex>;
|
|
1712
1849
|
/**
|
|
1713
1850
|
* If `true` this attribute contains space-separated tokens and each token must
|
|
1714
1851
|
* be valid by itself.
|
|
@@ -1718,6 +1855,16 @@ export declare interface MetaAttribute {
|
|
|
1718
1855
|
* If `true` this attribute can omit the value.
|
|
1719
1856
|
*/
|
|
1720
1857
|
omit?: boolean;
|
|
1858
|
+
/**
|
|
1859
|
+
* When set, this attribute references another element by the given type. If
|
|
1860
|
+
* `list` is also set, each individual token in the attribute value references another
|
|
1861
|
+
* element.
|
|
1862
|
+
*
|
|
1863
|
+
* - `id`: the attribute value references the id of another element in the document.
|
|
1864
|
+
*
|
|
1865
|
+
* @since 11.4.0
|
|
1866
|
+
*/
|
|
1867
|
+
reference?: "id";
|
|
1721
1868
|
/**
|
|
1722
1869
|
* If set this attribute is required to be present on the element.
|
|
1723
1870
|
*/
|
|
@@ -1735,6 +1882,19 @@ export declare interface MetaAttribute {
|
|
|
1735
1882
|
*/
|
|
1736
1883
|
export declare type MetaAttributeAllowedCallback = (node: HtmlElementLike, attr: string | DynamicValue | null | undefined) => string | null | undefined;
|
|
1737
1884
|
|
|
1885
|
+
/**
|
|
1886
|
+
* A named regular expression for use in attribute value validation.
|
|
1887
|
+
*
|
|
1888
|
+
* @public
|
|
1889
|
+
* @since 11.5.0
|
|
1890
|
+
*/
|
|
1891
|
+
export declare interface MetaAttributeNamedRegex {
|
|
1892
|
+
/** Human-readable label shown in error documentation. */
|
|
1893
|
+
name: string;
|
|
1894
|
+
/** Regular expression used for validation. */
|
|
1895
|
+
pattern: RegExp | string;
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1738
1898
|
/**
|
|
1739
1899
|
* Callback for the `required` property of `MetaAttribute`.
|
|
1740
1900
|
*
|
|
@@ -2454,7 +2614,7 @@ export declare class ResolvedConfig {
|
|
|
2454
2614
|
* Returns the (merged) configuration data used to create this resolved
|
|
2455
2615
|
* configuration.
|
|
2456
2616
|
*/
|
|
2457
|
-
getConfigData(): ConfigData;
|
|
2617
|
+
getConfigData(): ConfigData | FlatConfig;
|
|
2458
2618
|
getMetaTable(): MetaTable;
|
|
2459
2619
|
getPlugins(): Plugin_2[];
|
|
2460
2620
|
getRules(): Map<string, [Severity, RuleOptions]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FlatConfigObject } from "html-validate";
|
|
2
|
+
|
|
3
|
+
export declare const a11y: FlatConfigObject;
|
|
4
|
+
export declare const browser: FlatConfigObject;
|
|
5
|
+
export declare const document: FlatConfigObject;
|
|
6
|
+
export declare const prettier: FlatConfigObject;
|
|
7
|
+
export declare const recommended: FlatConfigObject;
|
|
8
|
+
export declare const standard: FlatConfigObject;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "html-validate",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.0",
|
|
4
4
|
"description": "Offline HTML5 validator and linter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"html",
|
|
@@ -62,6 +62,11 @@
|
|
|
62
62
|
"import": "./dist/esm/html5.js",
|
|
63
63
|
"require": "./dist/cjs/html5.js"
|
|
64
64
|
},
|
|
65
|
+
"./presets": {
|
|
66
|
+
"types": "./dist/types/presets.d.ts",
|
|
67
|
+
"import": "./dist/esm/presets.js",
|
|
68
|
+
"require": "./dist/cjs/presets.js"
|
|
69
|
+
},
|
|
65
70
|
"./jest": {
|
|
66
71
|
"types": "./dist/types/jest.d.ts",
|
|
67
72
|
"import": "./dist/esm/jest.js",
|
|
@@ -121,6 +126,6 @@
|
|
|
121
126
|
}
|
|
122
127
|
},
|
|
123
128
|
"engines": {
|
|
124
|
-
"node": "^22.
|
|
129
|
+
"node": "^22.22.0 || >= 24.8.0"
|
|
125
130
|
}
|
|
126
131
|
}
|