html-validate 10.10.0 → 10.11.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/core.js +108 -70
- package/dist/cjs/core.js.map +1 -1
- package/dist/esm/core.js +108 -70
- package/dist/esm/core.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/core.js
CHANGED
|
@@ -1853,7 +1853,7 @@ class DOMNode {
|
|
|
1853
1853
|
}
|
|
1854
1854
|
_removeChild(node) {
|
|
1855
1855
|
const index = this.childNodes.findIndex((it) => it.isSameNode(node));
|
|
1856
|
-
if (index
|
|
1856
|
+
if (index !== -1) {
|
|
1857
1857
|
this.childNodes.splice(index, 1);
|
|
1858
1858
|
} else {
|
|
1859
1859
|
throw new Error("DOMException: _removeChild(..) could not find child to remove");
|
|
@@ -2576,7 +2576,7 @@ class HtmlElement extends DOMNode {
|
|
|
2576
2576
|
return attr.value;
|
|
2577
2577
|
}
|
|
2578
2578
|
const list = new DOMTokenList(attr.value, attr.valueLocation);
|
|
2579
|
-
return list.length ? Array.from(list) : null;
|
|
2579
|
+
return list.length > 0 ? Array.from(list) : null;
|
|
2580
2580
|
}
|
|
2581
2581
|
/**
|
|
2582
2582
|
* Similar to childNodes but only elements.
|
|
@@ -4028,7 +4028,7 @@ class Rule {
|
|
|
4028
4028
|
}
|
|
4029
4029
|
}
|
|
4030
4030
|
|
|
4031
|
-
const defaults$
|
|
4031
|
+
const defaults$C = {
|
|
4032
4032
|
allowExternal: true,
|
|
4033
4033
|
allowRelative: true,
|
|
4034
4034
|
allowAbsolute: true,
|
|
@@ -4072,7 +4072,7 @@ class AllowedLinks extends Rule {
|
|
|
4072
4072
|
allowRelative;
|
|
4073
4073
|
allowAbsolute;
|
|
4074
4074
|
constructor(options) {
|
|
4075
|
-
super({ ...defaults$
|
|
4075
|
+
super({ ...defaults$C, ...options });
|
|
4076
4076
|
this.allowExternal = parseAllow(this.options.allowExternal);
|
|
4077
4077
|
this.allowRelative = parseAllow(this.options.allowRelative);
|
|
4078
4078
|
this.allowAbsolute = parseAllow(this.options.allowAbsolute);
|
|
@@ -4240,7 +4240,7 @@ class AllowedLinks extends Rule {
|
|
|
4240
4240
|
}
|
|
4241
4241
|
}
|
|
4242
4242
|
|
|
4243
|
-
const defaults$
|
|
4243
|
+
const defaults$B = {
|
|
4244
4244
|
accessible: true
|
|
4245
4245
|
};
|
|
4246
4246
|
function findByTarget(target, siblings) {
|
|
@@ -4270,7 +4270,7 @@ function getDescription$1(context) {
|
|
|
4270
4270
|
}
|
|
4271
4271
|
class AreaAlt extends Rule {
|
|
4272
4272
|
constructor(options) {
|
|
4273
|
-
super({ ...defaults$
|
|
4273
|
+
super({ ...defaults$B, ...options });
|
|
4274
4274
|
}
|
|
4275
4275
|
static schema() {
|
|
4276
4276
|
return {
|
|
@@ -4349,7 +4349,7 @@ class AriaHiddenBody extends Rule {
|
|
|
4349
4349
|
}
|
|
4350
4350
|
}
|
|
4351
4351
|
|
|
4352
|
-
const defaults$
|
|
4352
|
+
const defaults$A = {
|
|
4353
4353
|
allowAnyNamable: false,
|
|
4354
4354
|
elements: {
|
|
4355
4355
|
include: null,
|
|
@@ -4397,7 +4397,7 @@ function isValidUsage(target, meta) {
|
|
|
4397
4397
|
}
|
|
4398
4398
|
class AriaLabelMisuse extends Rule {
|
|
4399
4399
|
constructor(options) {
|
|
4400
|
-
super({ ...defaults$
|
|
4400
|
+
super({ ...defaults$A, ...options });
|
|
4401
4401
|
}
|
|
4402
4402
|
static schema() {
|
|
4403
4403
|
return {
|
|
@@ -4565,14 +4565,14 @@ class CaseStyle {
|
|
|
4565
4565
|
}
|
|
4566
4566
|
}
|
|
4567
4567
|
|
|
4568
|
-
const defaults$
|
|
4568
|
+
const defaults$z = {
|
|
4569
4569
|
style: "lowercase",
|
|
4570
4570
|
ignoreForeign: true
|
|
4571
4571
|
};
|
|
4572
4572
|
class AttrCase extends Rule {
|
|
4573
4573
|
style;
|
|
4574
4574
|
constructor(options) {
|
|
4575
|
-
super({ ...defaults$
|
|
4575
|
+
super({ ...defaults$z, ...options });
|
|
4576
4576
|
this.style = new CaseStyle(this.options.style, "attr-case");
|
|
4577
4577
|
}
|
|
4578
4578
|
static schema() {
|
|
@@ -4988,7 +4988,7 @@ class AttrDelimiter extends Rule {
|
|
|
4988
4988
|
}
|
|
4989
4989
|
|
|
4990
4990
|
const DEFAULT_PATTERN = "[a-z0-9-:]+";
|
|
4991
|
-
const defaults$
|
|
4991
|
+
const defaults$y = {
|
|
4992
4992
|
pattern: DEFAULT_PATTERN,
|
|
4993
4993
|
ignoreForeign: true
|
|
4994
4994
|
};
|
|
@@ -5021,7 +5021,7 @@ function generateDescription(name, pattern) {
|
|
|
5021
5021
|
class AttrPattern extends Rule {
|
|
5022
5022
|
pattern;
|
|
5023
5023
|
constructor(options) {
|
|
5024
|
-
super({ ...defaults$
|
|
5024
|
+
super({ ...defaults$y, ...options });
|
|
5025
5025
|
this.pattern = generateRegexp(this.options.pattern);
|
|
5026
5026
|
}
|
|
5027
5027
|
static schema() {
|
|
@@ -5068,7 +5068,7 @@ class AttrPattern extends Rule {
|
|
|
5068
5068
|
}
|
|
5069
5069
|
}
|
|
5070
5070
|
|
|
5071
|
-
const defaults$
|
|
5071
|
+
const defaults$x = {
|
|
5072
5072
|
style: "auto",
|
|
5073
5073
|
unquoted: false
|
|
5074
5074
|
};
|
|
@@ -5134,7 +5134,7 @@ class AttrQuotes extends Rule {
|
|
|
5134
5134
|
};
|
|
5135
5135
|
}
|
|
5136
5136
|
constructor(options) {
|
|
5137
|
-
super({ ...defaults$
|
|
5137
|
+
super({ ...defaults$x, ...options });
|
|
5138
5138
|
this.style = parseStyle$3(this.options.style);
|
|
5139
5139
|
}
|
|
5140
5140
|
setup() {
|
|
@@ -5290,13 +5290,13 @@ class AttributeAllowedValues extends Rule {
|
|
|
5290
5290
|
}
|
|
5291
5291
|
}
|
|
5292
5292
|
|
|
5293
|
-
const defaults$
|
|
5293
|
+
const defaults$w = {
|
|
5294
5294
|
style: "omit"
|
|
5295
5295
|
};
|
|
5296
5296
|
class AttributeBooleanStyle extends Rule {
|
|
5297
5297
|
hasInvalidStyle;
|
|
5298
5298
|
constructor(options) {
|
|
5299
|
-
super({ ...defaults$
|
|
5299
|
+
super({ ...defaults$w, ...options });
|
|
5300
5300
|
this.hasInvalidStyle = parseStyle$2(this.options.style);
|
|
5301
5301
|
}
|
|
5302
5302
|
static schema() {
|
|
@@ -5366,13 +5366,13 @@ function reportMessage$1(attr, style) {
|
|
|
5366
5366
|
return "";
|
|
5367
5367
|
}
|
|
5368
5368
|
|
|
5369
|
-
const defaults$
|
|
5369
|
+
const defaults$v = {
|
|
5370
5370
|
style: "omit"
|
|
5371
5371
|
};
|
|
5372
5372
|
class AttributeEmptyStyle extends Rule {
|
|
5373
5373
|
hasInvalidStyle;
|
|
5374
5374
|
constructor(options) {
|
|
5375
|
-
super({ ...defaults$
|
|
5375
|
+
super({ ...defaults$v, ...options });
|
|
5376
5376
|
this.hasInvalidStyle = parseStyle$1(this.options.style);
|
|
5377
5377
|
}
|
|
5378
5378
|
static schema() {
|
|
@@ -5489,7 +5489,7 @@ class AttributeMisuse extends Rule {
|
|
|
5489
5489
|
}
|
|
5490
5490
|
}
|
|
5491
5491
|
|
|
5492
|
-
const defaults$
|
|
5492
|
+
const defaults$u = {
|
|
5493
5493
|
preferred: void 0
|
|
5494
5494
|
};
|
|
5495
5495
|
function isPasswordInput(event) {
|
|
@@ -5506,7 +5506,7 @@ function isGroupingToken(token) {
|
|
|
5506
5506
|
class AutocompletePassword extends Rule {
|
|
5507
5507
|
preferred;
|
|
5508
5508
|
constructor(options) {
|
|
5509
|
-
super({ ...defaults$
|
|
5509
|
+
super({ ...defaults$u, ...options });
|
|
5510
5510
|
this.preferred = options.preferred?.toLowerCase();
|
|
5511
5511
|
}
|
|
5512
5512
|
static schema() {
|
|
@@ -5585,21 +5585,19 @@ class AutocompletePassword extends Rule {
|
|
|
5585
5585
|
});
|
|
5586
5586
|
return;
|
|
5587
5587
|
}
|
|
5588
|
-
if (preferred) {
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
});
|
|
5602
|
-
}
|
|
5588
|
+
if (preferred && value !== preferred) {
|
|
5589
|
+
const context = {
|
|
5590
|
+
kind: "preferred-mismatch",
|
|
5591
|
+
value,
|
|
5592
|
+
preferred
|
|
5593
|
+
};
|
|
5594
|
+
this.report({
|
|
5595
|
+
node: target,
|
|
5596
|
+
message: `<input type="password"> should use autocomplete="${preferred}"`,
|
|
5597
|
+
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- location must be present if value is */
|
|
5598
|
+
location,
|
|
5599
|
+
context
|
|
5600
|
+
});
|
|
5603
5601
|
}
|
|
5604
5602
|
});
|
|
5605
5603
|
}
|
|
@@ -5736,7 +5734,7 @@ class BasePatternRule extends Rule {
|
|
|
5736
5734
|
}
|
|
5737
5735
|
}
|
|
5738
5736
|
|
|
5739
|
-
const defaults$
|
|
5737
|
+
const defaults$t = {
|
|
5740
5738
|
pattern: "kebabcase"
|
|
5741
5739
|
};
|
|
5742
5740
|
class ClassPattern extends BasePatternRule {
|
|
@@ -5744,7 +5742,7 @@ class ClassPattern extends BasePatternRule {
|
|
|
5744
5742
|
super({
|
|
5745
5743
|
ruleId: "class-pattern",
|
|
5746
5744
|
attr: "class",
|
|
5747
|
-
options: { ...defaults$
|
|
5745
|
+
options: { ...defaults$t, ...options },
|
|
5748
5746
|
allowedPatterns: patternNames
|
|
5749
5747
|
// allow all patterns
|
|
5750
5748
|
});
|
|
@@ -5894,13 +5892,13 @@ class CloseOrder extends Rule {
|
|
|
5894
5892
|
}
|
|
5895
5893
|
}
|
|
5896
5894
|
|
|
5897
|
-
const defaults$
|
|
5895
|
+
const defaults$s = {
|
|
5898
5896
|
include: null,
|
|
5899
5897
|
exclude: null
|
|
5900
5898
|
};
|
|
5901
5899
|
class Deprecated extends Rule {
|
|
5902
5900
|
constructor(options) {
|
|
5903
|
-
super({ ...defaults$
|
|
5901
|
+
super({ ...defaults$s, ...options });
|
|
5904
5902
|
}
|
|
5905
5903
|
static schema() {
|
|
5906
5904
|
return {
|
|
@@ -6012,7 +6010,7 @@ function quote(value, char = '"') {
|
|
|
6012
6010
|
return `${char}${value}${char}`;
|
|
6013
6011
|
}
|
|
6014
6012
|
|
|
6015
|
-
const defaults$
|
|
6013
|
+
const defaults$r = {
|
|
6016
6014
|
classes: []
|
|
6017
6015
|
};
|
|
6018
6016
|
function isRelevant$6(event) {
|
|
@@ -6066,7 +6064,7 @@ ${listItems.join("\n")}`);
|
|
|
6066
6064
|
class DeprecatedClass extends Rule {
|
|
6067
6065
|
deprecatedMap;
|
|
6068
6066
|
constructor(options) {
|
|
6069
|
-
super({ ...defaults$
|
|
6067
|
+
super({ ...defaults$r, ...options });
|
|
6070
6068
|
const { classes } = this.options;
|
|
6071
6069
|
this.deprecatedMap = new Map(classes.map((entry) => [entry.class, normalizeEntry(entry)]));
|
|
6072
6070
|
}
|
|
@@ -6185,12 +6183,12 @@ let NoStyleTag$1 = class NoStyleTag extends Rule {
|
|
|
6185
6183
|
}
|
|
6186
6184
|
};
|
|
6187
6185
|
|
|
6188
|
-
const defaults$
|
|
6186
|
+
const defaults$q = {
|
|
6189
6187
|
style: "uppercase"
|
|
6190
6188
|
};
|
|
6191
6189
|
class DoctypeStyle extends Rule {
|
|
6192
6190
|
constructor(options) {
|
|
6193
|
-
super({ ...defaults$
|
|
6191
|
+
super({ ...defaults$q, ...options });
|
|
6194
6192
|
}
|
|
6195
6193
|
static schema() {
|
|
6196
6194
|
return {
|
|
@@ -6218,13 +6216,13 @@ class DoctypeStyle extends Rule {
|
|
|
6218
6216
|
}
|
|
6219
6217
|
}
|
|
6220
6218
|
|
|
6221
|
-
const defaults$
|
|
6219
|
+
const defaults$p = {
|
|
6222
6220
|
style: "lowercase"
|
|
6223
6221
|
};
|
|
6224
6222
|
class ElementCase extends Rule {
|
|
6225
6223
|
style;
|
|
6226
6224
|
constructor(options) {
|
|
6227
|
-
super({ ...defaults$
|
|
6225
|
+
super({ ...defaults$p, ...options });
|
|
6228
6226
|
this.style = new CaseStyle(this.options.style, "element-case");
|
|
6229
6227
|
}
|
|
6230
6228
|
static schema() {
|
|
@@ -6284,7 +6282,7 @@ class ElementCase extends Rule {
|
|
|
6284
6282
|
}
|
|
6285
6283
|
}
|
|
6286
6284
|
|
|
6287
|
-
const defaults$
|
|
6285
|
+
const defaults$o = {
|
|
6288
6286
|
pattern: "^[a-z][a-z0-9\\-._]*-[a-z0-9\\-._]*$",
|
|
6289
6287
|
whitelist: [],
|
|
6290
6288
|
blacklist: []
|
|
@@ -6292,7 +6290,7 @@ const defaults$n = {
|
|
|
6292
6290
|
class ElementName extends Rule {
|
|
6293
6291
|
pattern;
|
|
6294
6292
|
constructor(options) {
|
|
6295
|
-
super({ ...defaults$
|
|
6293
|
+
super({ ...defaults$o, ...options });
|
|
6296
6294
|
this.pattern = new RegExp(this.options.pattern);
|
|
6297
6295
|
}
|
|
6298
6296
|
static schema() {
|
|
@@ -6329,7 +6327,7 @@ class ElementName extends Rule {
|
|
|
6329
6327
|
...context.blacklist.map((cur) => `- ${cur}`)
|
|
6330
6328
|
];
|
|
6331
6329
|
}
|
|
6332
|
-
if (context.pattern !== defaults$
|
|
6330
|
+
if (context.pattern !== defaults$o.pattern) {
|
|
6333
6331
|
return [
|
|
6334
6332
|
`<${context.tagName}> is not a valid element name. This project is configured to only allow names matching the following regular expression:`,
|
|
6335
6333
|
"",
|
|
@@ -6846,7 +6844,7 @@ class EmptyTitle extends Rule {
|
|
|
6846
6844
|
}
|
|
6847
6845
|
}
|
|
6848
6846
|
|
|
6849
|
-
const defaults$
|
|
6847
|
+
const defaults$n = {
|
|
6850
6848
|
allowArrayBrackets: true,
|
|
6851
6849
|
allowCheckboxDefault: true,
|
|
6852
6850
|
shared: ["radio", "button", "reset", "submit"]
|
|
@@ -6913,7 +6911,7 @@ function getDocumentation(context) {
|
|
|
6913
6911
|
}
|
|
6914
6912
|
class FormDupName extends Rule {
|
|
6915
6913
|
constructor(options) {
|
|
6916
|
-
super({ ...defaults$
|
|
6914
|
+
super({ ...defaults$n, ...options });
|
|
6917
6915
|
}
|
|
6918
6916
|
static schema() {
|
|
6919
6917
|
return {
|
|
@@ -7072,7 +7070,7 @@ class FormDupName extends Rule {
|
|
|
7072
7070
|
}
|
|
7073
7071
|
}
|
|
7074
7072
|
|
|
7075
|
-
const defaults$
|
|
7073
|
+
const defaults$m = {
|
|
7076
7074
|
allowMultipleH1: false,
|
|
7077
7075
|
minInitialRank: "h1",
|
|
7078
7076
|
sectioningRoots: ["dialog", '[role="dialog"]', '[role="alertdialog"]']
|
|
@@ -7104,7 +7102,7 @@ class HeadingLevel extends Rule {
|
|
|
7104
7102
|
sectionRoots;
|
|
7105
7103
|
stack = [];
|
|
7106
7104
|
constructor(options) {
|
|
7107
|
-
super({ ...defaults$
|
|
7105
|
+
super({ ...defaults$m, ...options });
|
|
7108
7106
|
this.minInitialRank = parseMaxInitial(this.options.minInitialRank);
|
|
7109
7107
|
this.sectionRoots = this.options.sectioningRoots.map((it) => new Compound(it));
|
|
7110
7108
|
this.stack.push({
|
|
@@ -7343,7 +7341,7 @@ class HiddenFocusable extends Rule {
|
|
|
7343
7341
|
}
|
|
7344
7342
|
}
|
|
7345
7343
|
|
|
7346
|
-
const defaults$
|
|
7344
|
+
const defaults$l = {
|
|
7347
7345
|
pattern: "kebabcase"
|
|
7348
7346
|
};
|
|
7349
7347
|
function exclude$1(set, ...values) {
|
|
@@ -7359,7 +7357,7 @@ class IdPattern extends BasePatternRule {
|
|
|
7359
7357
|
super({
|
|
7360
7358
|
ruleId: "id-pattern",
|
|
7361
7359
|
attr: "id",
|
|
7362
|
-
options: { ...defaults$
|
|
7360
|
+
options: { ...defaults$l, ...options },
|
|
7363
7361
|
allowedPatterns
|
|
7364
7362
|
});
|
|
7365
7363
|
}
|
|
@@ -7681,13 +7679,13 @@ function findLabelByParent(el) {
|
|
|
7681
7679
|
return [];
|
|
7682
7680
|
}
|
|
7683
7681
|
|
|
7684
|
-
const defaults$
|
|
7682
|
+
const defaults$k = {
|
|
7685
7683
|
maxlength: 70
|
|
7686
7684
|
};
|
|
7687
7685
|
class LongTitle extends Rule {
|
|
7688
7686
|
maxlength;
|
|
7689
7687
|
constructor(options) {
|
|
7690
|
-
super({ ...defaults$
|
|
7688
|
+
super({ ...defaults$k, ...options });
|
|
7691
7689
|
this.maxlength = this.options.maxlength;
|
|
7692
7690
|
}
|
|
7693
7691
|
static schema() {
|
|
@@ -7791,12 +7789,12 @@ class MapIdName extends Rule {
|
|
|
7791
7789
|
}
|
|
7792
7790
|
}
|
|
7793
7791
|
|
|
7794
|
-
const defaults$
|
|
7792
|
+
const defaults$j = {
|
|
7795
7793
|
allowLongDelay: false
|
|
7796
7794
|
};
|
|
7797
7795
|
class MetaRefresh extends Rule {
|
|
7798
7796
|
constructor(options) {
|
|
7799
|
-
super({ ...defaults$
|
|
7797
|
+
super({ ...defaults$j, ...options });
|
|
7800
7798
|
}
|
|
7801
7799
|
documentation() {
|
|
7802
7800
|
return {
|
|
@@ -7907,7 +7905,7 @@ class MultipleLabeledControls extends Rule {
|
|
|
7907
7905
|
}
|
|
7908
7906
|
}
|
|
7909
7907
|
|
|
7910
|
-
const defaults$
|
|
7908
|
+
const defaults$i = {
|
|
7911
7909
|
pattern: "camelcase"
|
|
7912
7910
|
};
|
|
7913
7911
|
function exclude(set, ...values) {
|
|
@@ -7923,7 +7921,7 @@ class NamePattern extends BasePatternRule {
|
|
|
7923
7921
|
super({
|
|
7924
7922
|
ruleId: "name-pattern",
|
|
7925
7923
|
attr: "name",
|
|
7926
|
-
options: { ...defaults$
|
|
7924
|
+
options: { ...defaults$i, ...options },
|
|
7927
7925
|
allowedPatterns
|
|
7928
7926
|
});
|
|
7929
7927
|
}
|
|
@@ -8014,13 +8012,13 @@ class NoAbstractRole extends Rule {
|
|
|
8014
8012
|
}
|
|
8015
8013
|
}
|
|
8016
8014
|
|
|
8017
|
-
const defaults$
|
|
8015
|
+
const defaults$h = {
|
|
8018
8016
|
include: null,
|
|
8019
8017
|
exclude: null
|
|
8020
8018
|
};
|
|
8021
8019
|
class NoAutoplay extends Rule {
|
|
8022
8020
|
constructor(options) {
|
|
8023
|
-
super({ ...defaults$
|
|
8021
|
+
super({ ...defaults$h, ...options });
|
|
8024
8022
|
}
|
|
8025
8023
|
documentation(context) {
|
|
8026
8024
|
return {
|
|
@@ -8341,14 +8339,14 @@ class NoImplicitInputType extends Rule {
|
|
|
8341
8339
|
}
|
|
8342
8340
|
}
|
|
8343
8341
|
|
|
8344
|
-
const defaults$
|
|
8342
|
+
const defaults$g = {
|
|
8345
8343
|
include: null,
|
|
8346
8344
|
exclude: null,
|
|
8347
8345
|
allowedProperties: ["display"]
|
|
8348
8346
|
};
|
|
8349
8347
|
class NoInlineStyle extends Rule {
|
|
8350
8348
|
constructor(options) {
|
|
8351
|
-
super({ ...defaults$
|
|
8349
|
+
super({ ...defaults$g, ...options });
|
|
8352
8350
|
}
|
|
8353
8351
|
static schema() {
|
|
8354
8352
|
return {
|
|
@@ -8534,7 +8532,7 @@ class NoMultipleMain extends Rule {
|
|
|
8534
8532
|
}
|
|
8535
8533
|
}
|
|
8536
8534
|
|
|
8537
|
-
const defaults$
|
|
8535
|
+
const defaults$f = {
|
|
8538
8536
|
relaxed: false
|
|
8539
8537
|
};
|
|
8540
8538
|
const textRegexp = /([<>]|&(?![a-zA-Z0-9#]+;))/g;
|
|
@@ -8552,7 +8550,7 @@ const replacementTable = {
|
|
|
8552
8550
|
class NoRawCharacters extends Rule {
|
|
8553
8551
|
relaxed;
|
|
8554
8552
|
constructor(options) {
|
|
8555
|
-
super({ ...defaults$
|
|
8553
|
+
super({ ...defaults$f, ...options });
|
|
8556
8554
|
this.relaxed = this.options.relaxed;
|
|
8557
8555
|
}
|
|
8558
8556
|
static schema() {
|
|
@@ -8691,7 +8689,14 @@ class NoRedundantFor extends Rule {
|
|
|
8691
8689
|
}
|
|
8692
8690
|
}
|
|
8693
8691
|
|
|
8692
|
+
const defaults$e = {
|
|
8693
|
+
include: null,
|
|
8694
|
+
exclude: null
|
|
8695
|
+
};
|
|
8694
8696
|
class NoRedundantRole extends Rule {
|
|
8697
|
+
constructor(options) {
|
|
8698
|
+
super({ ...defaults$e, ...options });
|
|
8699
|
+
}
|
|
8695
8700
|
documentation(context) {
|
|
8696
8701
|
const { role, tagName } = context;
|
|
8697
8702
|
return {
|
|
@@ -8699,6 +8704,36 @@ class NoRedundantRole extends Rule {
|
|
|
8699
8704
|
url: "https://html-validate.org/rules/no-redundant-role.html"
|
|
8700
8705
|
};
|
|
8701
8706
|
}
|
|
8707
|
+
static schema() {
|
|
8708
|
+
return {
|
|
8709
|
+
exclude: {
|
|
8710
|
+
anyOf: [
|
|
8711
|
+
{
|
|
8712
|
+
items: {
|
|
8713
|
+
type: "string"
|
|
8714
|
+
},
|
|
8715
|
+
type: "array"
|
|
8716
|
+
},
|
|
8717
|
+
{
|
|
8718
|
+
type: "null"
|
|
8719
|
+
}
|
|
8720
|
+
]
|
|
8721
|
+
},
|
|
8722
|
+
include: {
|
|
8723
|
+
anyOf: [
|
|
8724
|
+
{
|
|
8725
|
+
items: {
|
|
8726
|
+
type: "string"
|
|
8727
|
+
},
|
|
8728
|
+
type: "array"
|
|
8729
|
+
},
|
|
8730
|
+
{
|
|
8731
|
+
type: "null"
|
|
8732
|
+
}
|
|
8733
|
+
]
|
|
8734
|
+
}
|
|
8735
|
+
};
|
|
8736
|
+
}
|
|
8702
8737
|
setup() {
|
|
8703
8738
|
this.on("tag:ready", (event) => {
|
|
8704
8739
|
const { target } = event;
|
|
@@ -8717,6 +8752,9 @@ class NoRedundantRole extends Rule {
|
|
|
8717
8752
|
if (role.value !== implicitRole) {
|
|
8718
8753
|
return;
|
|
8719
8754
|
}
|
|
8755
|
+
if (this.isKeywordIgnored(role.value)) {
|
|
8756
|
+
return;
|
|
8757
|
+
}
|
|
8720
8758
|
const context = {
|
|
8721
8759
|
tagName: target.tagName,
|
|
8722
8760
|
role: role.value
|
|
@@ -8910,7 +8948,7 @@ class NoUnusedDisable extends Rule {
|
|
|
8910
8948
|
const tokens = new DOMTokenList(options.replaceAll(",", " "), location);
|
|
8911
8949
|
for (const ruleId of unused) {
|
|
8912
8950
|
const index = tokens.indexOf(ruleId);
|
|
8913
|
-
const tokenLocation = index
|
|
8951
|
+
const tokenLocation = index !== -1 ? tokens.location(index) : location;
|
|
8914
8952
|
this.report({
|
|
8915
8953
|
node: null,
|
|
8916
8954
|
message: '"{{ ruleId }}" rule is disabled but no error was reported',
|
|
@@ -9158,7 +9196,7 @@ class PreferTbody extends Rule {
|
|
|
9158
9196
|
continue;
|
|
9159
9197
|
}
|
|
9160
9198
|
const tr = table.querySelectorAll("> tr");
|
|
9161
|
-
if (tr.length
|
|
9199
|
+
if (tr.length > 0) {
|
|
9162
9200
|
this.report(tr[0], "Prefer to wrap <tr> elements in <tbody>");
|
|
9163
9201
|
}
|
|
9164
9202
|
}
|
|
@@ -10942,7 +10980,7 @@ function isSimpleTable(table) {
|
|
|
10942
10980
|
}
|
|
10943
10981
|
const shape = getShape(cells);
|
|
10944
10982
|
const headersPerRow = cells.map((row) => row.reduce((sum, cell) => sum + cell, 0));
|
|
10945
|
-
const headersPerColumn = Array(shape.cols).fill(0).map((_, index) => {
|
|
10983
|
+
const headersPerColumn = new Array(shape.cols).fill(0).map((_, index) => {
|
|
10946
10984
|
return cells.reduce((sum, it) => sum + it[index], 0);
|
|
10947
10985
|
});
|
|
10948
10986
|
const [firstRow, ...otherRows] = headersPerRow;
|
|
@@ -12464,7 +12502,7 @@ class EventHandler {
|
|
|
12464
12502
|
}
|
|
12465
12503
|
|
|
12466
12504
|
const name = "html-validate";
|
|
12467
|
-
const version = "10.
|
|
12505
|
+
const version = "10.11.0";
|
|
12468
12506
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
12469
12507
|
|
|
12470
12508
|
function freeze(src) {
|