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/esm/core.js
CHANGED
|
@@ -1844,7 +1844,7 @@ class DOMNode {
|
|
|
1844
1844
|
}
|
|
1845
1845
|
_removeChild(node) {
|
|
1846
1846
|
const index = this.childNodes.findIndex((it) => it.isSameNode(node));
|
|
1847
|
-
if (index
|
|
1847
|
+
if (index !== -1) {
|
|
1848
1848
|
this.childNodes.splice(index, 1);
|
|
1849
1849
|
} else {
|
|
1850
1850
|
throw new Error("DOMException: _removeChild(..) could not find child to remove");
|
|
@@ -2567,7 +2567,7 @@ class HtmlElement extends DOMNode {
|
|
|
2567
2567
|
return attr.value;
|
|
2568
2568
|
}
|
|
2569
2569
|
const list = new DOMTokenList(attr.value, attr.valueLocation);
|
|
2570
|
-
return list.length ? Array.from(list) : null;
|
|
2570
|
+
return list.length > 0 ? Array.from(list) : null;
|
|
2571
2571
|
}
|
|
2572
2572
|
/**
|
|
2573
2573
|
* Similar to childNodes but only elements.
|
|
@@ -4019,7 +4019,7 @@ class Rule {
|
|
|
4019
4019
|
}
|
|
4020
4020
|
}
|
|
4021
4021
|
|
|
4022
|
-
const defaults$
|
|
4022
|
+
const defaults$C = {
|
|
4023
4023
|
allowExternal: true,
|
|
4024
4024
|
allowRelative: true,
|
|
4025
4025
|
allowAbsolute: true,
|
|
@@ -4063,7 +4063,7 @@ class AllowedLinks extends Rule {
|
|
|
4063
4063
|
allowRelative;
|
|
4064
4064
|
allowAbsolute;
|
|
4065
4065
|
constructor(options) {
|
|
4066
|
-
super({ ...defaults$
|
|
4066
|
+
super({ ...defaults$C, ...options });
|
|
4067
4067
|
this.allowExternal = parseAllow(this.options.allowExternal);
|
|
4068
4068
|
this.allowRelative = parseAllow(this.options.allowRelative);
|
|
4069
4069
|
this.allowAbsolute = parseAllow(this.options.allowAbsolute);
|
|
@@ -4231,7 +4231,7 @@ class AllowedLinks extends Rule {
|
|
|
4231
4231
|
}
|
|
4232
4232
|
}
|
|
4233
4233
|
|
|
4234
|
-
const defaults$
|
|
4234
|
+
const defaults$B = {
|
|
4235
4235
|
accessible: true
|
|
4236
4236
|
};
|
|
4237
4237
|
function findByTarget(target, siblings) {
|
|
@@ -4261,7 +4261,7 @@ function getDescription$1(context) {
|
|
|
4261
4261
|
}
|
|
4262
4262
|
class AreaAlt extends Rule {
|
|
4263
4263
|
constructor(options) {
|
|
4264
|
-
super({ ...defaults$
|
|
4264
|
+
super({ ...defaults$B, ...options });
|
|
4265
4265
|
}
|
|
4266
4266
|
static schema() {
|
|
4267
4267
|
return {
|
|
@@ -4340,7 +4340,7 @@ class AriaHiddenBody extends Rule {
|
|
|
4340
4340
|
}
|
|
4341
4341
|
}
|
|
4342
4342
|
|
|
4343
|
-
const defaults$
|
|
4343
|
+
const defaults$A = {
|
|
4344
4344
|
allowAnyNamable: false,
|
|
4345
4345
|
elements: {
|
|
4346
4346
|
include: null,
|
|
@@ -4388,7 +4388,7 @@ function isValidUsage(target, meta) {
|
|
|
4388
4388
|
}
|
|
4389
4389
|
class AriaLabelMisuse extends Rule {
|
|
4390
4390
|
constructor(options) {
|
|
4391
|
-
super({ ...defaults$
|
|
4391
|
+
super({ ...defaults$A, ...options });
|
|
4392
4392
|
}
|
|
4393
4393
|
static schema() {
|
|
4394
4394
|
return {
|
|
@@ -4556,14 +4556,14 @@ class CaseStyle {
|
|
|
4556
4556
|
}
|
|
4557
4557
|
}
|
|
4558
4558
|
|
|
4559
|
-
const defaults$
|
|
4559
|
+
const defaults$z = {
|
|
4560
4560
|
style: "lowercase",
|
|
4561
4561
|
ignoreForeign: true
|
|
4562
4562
|
};
|
|
4563
4563
|
class AttrCase extends Rule {
|
|
4564
4564
|
style;
|
|
4565
4565
|
constructor(options) {
|
|
4566
|
-
super({ ...defaults$
|
|
4566
|
+
super({ ...defaults$z, ...options });
|
|
4567
4567
|
this.style = new CaseStyle(this.options.style, "attr-case");
|
|
4568
4568
|
}
|
|
4569
4569
|
static schema() {
|
|
@@ -4979,7 +4979,7 @@ class AttrDelimiter extends Rule {
|
|
|
4979
4979
|
}
|
|
4980
4980
|
|
|
4981
4981
|
const DEFAULT_PATTERN = "[a-z0-9-:]+";
|
|
4982
|
-
const defaults$
|
|
4982
|
+
const defaults$y = {
|
|
4983
4983
|
pattern: DEFAULT_PATTERN,
|
|
4984
4984
|
ignoreForeign: true
|
|
4985
4985
|
};
|
|
@@ -5012,7 +5012,7 @@ function generateDescription(name, pattern) {
|
|
|
5012
5012
|
class AttrPattern extends Rule {
|
|
5013
5013
|
pattern;
|
|
5014
5014
|
constructor(options) {
|
|
5015
|
-
super({ ...defaults$
|
|
5015
|
+
super({ ...defaults$y, ...options });
|
|
5016
5016
|
this.pattern = generateRegexp(this.options.pattern);
|
|
5017
5017
|
}
|
|
5018
5018
|
static schema() {
|
|
@@ -5059,7 +5059,7 @@ class AttrPattern extends Rule {
|
|
|
5059
5059
|
}
|
|
5060
5060
|
}
|
|
5061
5061
|
|
|
5062
|
-
const defaults$
|
|
5062
|
+
const defaults$x = {
|
|
5063
5063
|
style: "auto",
|
|
5064
5064
|
unquoted: false
|
|
5065
5065
|
};
|
|
@@ -5125,7 +5125,7 @@ class AttrQuotes extends Rule {
|
|
|
5125
5125
|
};
|
|
5126
5126
|
}
|
|
5127
5127
|
constructor(options) {
|
|
5128
|
-
super({ ...defaults$
|
|
5128
|
+
super({ ...defaults$x, ...options });
|
|
5129
5129
|
this.style = parseStyle$3(this.options.style);
|
|
5130
5130
|
}
|
|
5131
5131
|
setup() {
|
|
@@ -5281,13 +5281,13 @@ class AttributeAllowedValues extends Rule {
|
|
|
5281
5281
|
}
|
|
5282
5282
|
}
|
|
5283
5283
|
|
|
5284
|
-
const defaults$
|
|
5284
|
+
const defaults$w = {
|
|
5285
5285
|
style: "omit"
|
|
5286
5286
|
};
|
|
5287
5287
|
class AttributeBooleanStyle extends Rule {
|
|
5288
5288
|
hasInvalidStyle;
|
|
5289
5289
|
constructor(options) {
|
|
5290
|
-
super({ ...defaults$
|
|
5290
|
+
super({ ...defaults$w, ...options });
|
|
5291
5291
|
this.hasInvalidStyle = parseStyle$2(this.options.style);
|
|
5292
5292
|
}
|
|
5293
5293
|
static schema() {
|
|
@@ -5357,13 +5357,13 @@ function reportMessage$1(attr, style) {
|
|
|
5357
5357
|
return "";
|
|
5358
5358
|
}
|
|
5359
5359
|
|
|
5360
|
-
const defaults$
|
|
5360
|
+
const defaults$v = {
|
|
5361
5361
|
style: "omit"
|
|
5362
5362
|
};
|
|
5363
5363
|
class AttributeEmptyStyle extends Rule {
|
|
5364
5364
|
hasInvalidStyle;
|
|
5365
5365
|
constructor(options) {
|
|
5366
|
-
super({ ...defaults$
|
|
5366
|
+
super({ ...defaults$v, ...options });
|
|
5367
5367
|
this.hasInvalidStyle = parseStyle$1(this.options.style);
|
|
5368
5368
|
}
|
|
5369
5369
|
static schema() {
|
|
@@ -5480,7 +5480,7 @@ class AttributeMisuse extends Rule {
|
|
|
5480
5480
|
}
|
|
5481
5481
|
}
|
|
5482
5482
|
|
|
5483
|
-
const defaults$
|
|
5483
|
+
const defaults$u = {
|
|
5484
5484
|
preferred: void 0
|
|
5485
5485
|
};
|
|
5486
5486
|
function isPasswordInput(event) {
|
|
@@ -5497,7 +5497,7 @@ function isGroupingToken(token) {
|
|
|
5497
5497
|
class AutocompletePassword extends Rule {
|
|
5498
5498
|
preferred;
|
|
5499
5499
|
constructor(options) {
|
|
5500
|
-
super({ ...defaults$
|
|
5500
|
+
super({ ...defaults$u, ...options });
|
|
5501
5501
|
this.preferred = options.preferred?.toLowerCase();
|
|
5502
5502
|
}
|
|
5503
5503
|
static schema() {
|
|
@@ -5576,21 +5576,19 @@ class AutocompletePassword extends Rule {
|
|
|
5576
5576
|
});
|
|
5577
5577
|
return;
|
|
5578
5578
|
}
|
|
5579
|
-
if (preferred) {
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
});
|
|
5593
|
-
}
|
|
5579
|
+
if (preferred && value !== preferred) {
|
|
5580
|
+
const context = {
|
|
5581
|
+
kind: "preferred-mismatch",
|
|
5582
|
+
value,
|
|
5583
|
+
preferred
|
|
5584
|
+
};
|
|
5585
|
+
this.report({
|
|
5586
|
+
node: target,
|
|
5587
|
+
message: `<input type="password"> should use autocomplete="${preferred}"`,
|
|
5588
|
+
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- location must be present if value is */
|
|
5589
|
+
location,
|
|
5590
|
+
context
|
|
5591
|
+
});
|
|
5594
5592
|
}
|
|
5595
5593
|
});
|
|
5596
5594
|
}
|
|
@@ -5727,7 +5725,7 @@ class BasePatternRule extends Rule {
|
|
|
5727
5725
|
}
|
|
5728
5726
|
}
|
|
5729
5727
|
|
|
5730
|
-
const defaults$
|
|
5728
|
+
const defaults$t = {
|
|
5731
5729
|
pattern: "kebabcase"
|
|
5732
5730
|
};
|
|
5733
5731
|
class ClassPattern extends BasePatternRule {
|
|
@@ -5735,7 +5733,7 @@ class ClassPattern extends BasePatternRule {
|
|
|
5735
5733
|
super({
|
|
5736
5734
|
ruleId: "class-pattern",
|
|
5737
5735
|
attr: "class",
|
|
5738
|
-
options: { ...defaults$
|
|
5736
|
+
options: { ...defaults$t, ...options },
|
|
5739
5737
|
allowedPatterns: patternNames
|
|
5740
5738
|
// allow all patterns
|
|
5741
5739
|
});
|
|
@@ -5885,13 +5883,13 @@ class CloseOrder extends Rule {
|
|
|
5885
5883
|
}
|
|
5886
5884
|
}
|
|
5887
5885
|
|
|
5888
|
-
const defaults$
|
|
5886
|
+
const defaults$s = {
|
|
5889
5887
|
include: null,
|
|
5890
5888
|
exclude: null
|
|
5891
5889
|
};
|
|
5892
5890
|
class Deprecated extends Rule {
|
|
5893
5891
|
constructor(options) {
|
|
5894
|
-
super({ ...defaults$
|
|
5892
|
+
super({ ...defaults$s, ...options });
|
|
5895
5893
|
}
|
|
5896
5894
|
static schema() {
|
|
5897
5895
|
return {
|
|
@@ -6003,7 +6001,7 @@ function quote(value, char = '"') {
|
|
|
6003
6001
|
return `${char}${value}${char}`;
|
|
6004
6002
|
}
|
|
6005
6003
|
|
|
6006
|
-
const defaults$
|
|
6004
|
+
const defaults$r = {
|
|
6007
6005
|
classes: []
|
|
6008
6006
|
};
|
|
6009
6007
|
function isRelevant$6(event) {
|
|
@@ -6057,7 +6055,7 @@ ${listItems.join("\n")}`);
|
|
|
6057
6055
|
class DeprecatedClass extends Rule {
|
|
6058
6056
|
deprecatedMap;
|
|
6059
6057
|
constructor(options) {
|
|
6060
|
-
super({ ...defaults$
|
|
6058
|
+
super({ ...defaults$r, ...options });
|
|
6061
6059
|
const { classes } = this.options;
|
|
6062
6060
|
this.deprecatedMap = new Map(classes.map((entry) => [entry.class, normalizeEntry(entry)]));
|
|
6063
6061
|
}
|
|
@@ -6176,12 +6174,12 @@ let NoStyleTag$1 = class NoStyleTag extends Rule {
|
|
|
6176
6174
|
}
|
|
6177
6175
|
};
|
|
6178
6176
|
|
|
6179
|
-
const defaults$
|
|
6177
|
+
const defaults$q = {
|
|
6180
6178
|
style: "uppercase"
|
|
6181
6179
|
};
|
|
6182
6180
|
class DoctypeStyle extends Rule {
|
|
6183
6181
|
constructor(options) {
|
|
6184
|
-
super({ ...defaults$
|
|
6182
|
+
super({ ...defaults$q, ...options });
|
|
6185
6183
|
}
|
|
6186
6184
|
static schema() {
|
|
6187
6185
|
return {
|
|
@@ -6209,13 +6207,13 @@ class DoctypeStyle extends Rule {
|
|
|
6209
6207
|
}
|
|
6210
6208
|
}
|
|
6211
6209
|
|
|
6212
|
-
const defaults$
|
|
6210
|
+
const defaults$p = {
|
|
6213
6211
|
style: "lowercase"
|
|
6214
6212
|
};
|
|
6215
6213
|
class ElementCase extends Rule {
|
|
6216
6214
|
style;
|
|
6217
6215
|
constructor(options) {
|
|
6218
|
-
super({ ...defaults$
|
|
6216
|
+
super({ ...defaults$p, ...options });
|
|
6219
6217
|
this.style = new CaseStyle(this.options.style, "element-case");
|
|
6220
6218
|
}
|
|
6221
6219
|
static schema() {
|
|
@@ -6275,7 +6273,7 @@ class ElementCase extends Rule {
|
|
|
6275
6273
|
}
|
|
6276
6274
|
}
|
|
6277
6275
|
|
|
6278
|
-
const defaults$
|
|
6276
|
+
const defaults$o = {
|
|
6279
6277
|
pattern: "^[a-z][a-z0-9\\-._]*-[a-z0-9\\-._]*$",
|
|
6280
6278
|
whitelist: [],
|
|
6281
6279
|
blacklist: []
|
|
@@ -6283,7 +6281,7 @@ const defaults$n = {
|
|
|
6283
6281
|
class ElementName extends Rule {
|
|
6284
6282
|
pattern;
|
|
6285
6283
|
constructor(options) {
|
|
6286
|
-
super({ ...defaults$
|
|
6284
|
+
super({ ...defaults$o, ...options });
|
|
6287
6285
|
this.pattern = new RegExp(this.options.pattern);
|
|
6288
6286
|
}
|
|
6289
6287
|
static schema() {
|
|
@@ -6320,7 +6318,7 @@ class ElementName extends Rule {
|
|
|
6320
6318
|
...context.blacklist.map((cur) => `- ${cur}`)
|
|
6321
6319
|
];
|
|
6322
6320
|
}
|
|
6323
|
-
if (context.pattern !== defaults$
|
|
6321
|
+
if (context.pattern !== defaults$o.pattern) {
|
|
6324
6322
|
return [
|
|
6325
6323
|
`<${context.tagName}> is not a valid element name. This project is configured to only allow names matching the following regular expression:`,
|
|
6326
6324
|
"",
|
|
@@ -6837,7 +6835,7 @@ class EmptyTitle extends Rule {
|
|
|
6837
6835
|
}
|
|
6838
6836
|
}
|
|
6839
6837
|
|
|
6840
|
-
const defaults$
|
|
6838
|
+
const defaults$n = {
|
|
6841
6839
|
allowArrayBrackets: true,
|
|
6842
6840
|
allowCheckboxDefault: true,
|
|
6843
6841
|
shared: ["radio", "button", "reset", "submit"]
|
|
@@ -6904,7 +6902,7 @@ function getDocumentation(context) {
|
|
|
6904
6902
|
}
|
|
6905
6903
|
class FormDupName extends Rule {
|
|
6906
6904
|
constructor(options) {
|
|
6907
|
-
super({ ...defaults$
|
|
6905
|
+
super({ ...defaults$n, ...options });
|
|
6908
6906
|
}
|
|
6909
6907
|
static schema() {
|
|
6910
6908
|
return {
|
|
@@ -7063,7 +7061,7 @@ class FormDupName extends Rule {
|
|
|
7063
7061
|
}
|
|
7064
7062
|
}
|
|
7065
7063
|
|
|
7066
|
-
const defaults$
|
|
7064
|
+
const defaults$m = {
|
|
7067
7065
|
allowMultipleH1: false,
|
|
7068
7066
|
minInitialRank: "h1",
|
|
7069
7067
|
sectioningRoots: ["dialog", '[role="dialog"]', '[role="alertdialog"]']
|
|
@@ -7095,7 +7093,7 @@ class HeadingLevel extends Rule {
|
|
|
7095
7093
|
sectionRoots;
|
|
7096
7094
|
stack = [];
|
|
7097
7095
|
constructor(options) {
|
|
7098
|
-
super({ ...defaults$
|
|
7096
|
+
super({ ...defaults$m, ...options });
|
|
7099
7097
|
this.minInitialRank = parseMaxInitial(this.options.minInitialRank);
|
|
7100
7098
|
this.sectionRoots = this.options.sectioningRoots.map((it) => new Compound(it));
|
|
7101
7099
|
this.stack.push({
|
|
@@ -7334,7 +7332,7 @@ class HiddenFocusable extends Rule {
|
|
|
7334
7332
|
}
|
|
7335
7333
|
}
|
|
7336
7334
|
|
|
7337
|
-
const defaults$
|
|
7335
|
+
const defaults$l = {
|
|
7338
7336
|
pattern: "kebabcase"
|
|
7339
7337
|
};
|
|
7340
7338
|
function exclude$1(set, ...values) {
|
|
@@ -7350,7 +7348,7 @@ class IdPattern extends BasePatternRule {
|
|
|
7350
7348
|
super({
|
|
7351
7349
|
ruleId: "id-pattern",
|
|
7352
7350
|
attr: "id",
|
|
7353
|
-
options: { ...defaults$
|
|
7351
|
+
options: { ...defaults$l, ...options },
|
|
7354
7352
|
allowedPatterns
|
|
7355
7353
|
});
|
|
7356
7354
|
}
|
|
@@ -7672,13 +7670,13 @@ function findLabelByParent(el) {
|
|
|
7672
7670
|
return [];
|
|
7673
7671
|
}
|
|
7674
7672
|
|
|
7675
|
-
const defaults$
|
|
7673
|
+
const defaults$k = {
|
|
7676
7674
|
maxlength: 70
|
|
7677
7675
|
};
|
|
7678
7676
|
class LongTitle extends Rule {
|
|
7679
7677
|
maxlength;
|
|
7680
7678
|
constructor(options) {
|
|
7681
|
-
super({ ...defaults$
|
|
7679
|
+
super({ ...defaults$k, ...options });
|
|
7682
7680
|
this.maxlength = this.options.maxlength;
|
|
7683
7681
|
}
|
|
7684
7682
|
static schema() {
|
|
@@ -7782,12 +7780,12 @@ class MapIdName extends Rule {
|
|
|
7782
7780
|
}
|
|
7783
7781
|
}
|
|
7784
7782
|
|
|
7785
|
-
const defaults$
|
|
7783
|
+
const defaults$j = {
|
|
7786
7784
|
allowLongDelay: false
|
|
7787
7785
|
};
|
|
7788
7786
|
class MetaRefresh extends Rule {
|
|
7789
7787
|
constructor(options) {
|
|
7790
|
-
super({ ...defaults$
|
|
7788
|
+
super({ ...defaults$j, ...options });
|
|
7791
7789
|
}
|
|
7792
7790
|
documentation() {
|
|
7793
7791
|
return {
|
|
@@ -7898,7 +7896,7 @@ class MultipleLabeledControls extends Rule {
|
|
|
7898
7896
|
}
|
|
7899
7897
|
}
|
|
7900
7898
|
|
|
7901
|
-
const defaults$
|
|
7899
|
+
const defaults$i = {
|
|
7902
7900
|
pattern: "camelcase"
|
|
7903
7901
|
};
|
|
7904
7902
|
function exclude(set, ...values) {
|
|
@@ -7914,7 +7912,7 @@ class NamePattern extends BasePatternRule {
|
|
|
7914
7912
|
super({
|
|
7915
7913
|
ruleId: "name-pattern",
|
|
7916
7914
|
attr: "name",
|
|
7917
|
-
options: { ...defaults$
|
|
7915
|
+
options: { ...defaults$i, ...options },
|
|
7918
7916
|
allowedPatterns
|
|
7919
7917
|
});
|
|
7920
7918
|
}
|
|
@@ -8005,13 +8003,13 @@ class NoAbstractRole extends Rule {
|
|
|
8005
8003
|
}
|
|
8006
8004
|
}
|
|
8007
8005
|
|
|
8008
|
-
const defaults$
|
|
8006
|
+
const defaults$h = {
|
|
8009
8007
|
include: null,
|
|
8010
8008
|
exclude: null
|
|
8011
8009
|
};
|
|
8012
8010
|
class NoAutoplay extends Rule {
|
|
8013
8011
|
constructor(options) {
|
|
8014
|
-
super({ ...defaults$
|
|
8012
|
+
super({ ...defaults$h, ...options });
|
|
8015
8013
|
}
|
|
8016
8014
|
documentation(context) {
|
|
8017
8015
|
return {
|
|
@@ -8332,14 +8330,14 @@ class NoImplicitInputType extends Rule {
|
|
|
8332
8330
|
}
|
|
8333
8331
|
}
|
|
8334
8332
|
|
|
8335
|
-
const defaults$
|
|
8333
|
+
const defaults$g = {
|
|
8336
8334
|
include: null,
|
|
8337
8335
|
exclude: null,
|
|
8338
8336
|
allowedProperties: ["display"]
|
|
8339
8337
|
};
|
|
8340
8338
|
class NoInlineStyle extends Rule {
|
|
8341
8339
|
constructor(options) {
|
|
8342
|
-
super({ ...defaults$
|
|
8340
|
+
super({ ...defaults$g, ...options });
|
|
8343
8341
|
}
|
|
8344
8342
|
static schema() {
|
|
8345
8343
|
return {
|
|
@@ -8525,7 +8523,7 @@ class NoMultipleMain extends Rule {
|
|
|
8525
8523
|
}
|
|
8526
8524
|
}
|
|
8527
8525
|
|
|
8528
|
-
const defaults$
|
|
8526
|
+
const defaults$f = {
|
|
8529
8527
|
relaxed: false
|
|
8530
8528
|
};
|
|
8531
8529
|
const textRegexp = /([<>]|&(?![a-zA-Z0-9#]+;))/g;
|
|
@@ -8543,7 +8541,7 @@ const replacementTable = {
|
|
|
8543
8541
|
class NoRawCharacters extends Rule {
|
|
8544
8542
|
relaxed;
|
|
8545
8543
|
constructor(options) {
|
|
8546
|
-
super({ ...defaults$
|
|
8544
|
+
super({ ...defaults$f, ...options });
|
|
8547
8545
|
this.relaxed = this.options.relaxed;
|
|
8548
8546
|
}
|
|
8549
8547
|
static schema() {
|
|
@@ -8682,7 +8680,14 @@ class NoRedundantFor extends Rule {
|
|
|
8682
8680
|
}
|
|
8683
8681
|
}
|
|
8684
8682
|
|
|
8683
|
+
const defaults$e = {
|
|
8684
|
+
include: null,
|
|
8685
|
+
exclude: null
|
|
8686
|
+
};
|
|
8685
8687
|
class NoRedundantRole extends Rule {
|
|
8688
|
+
constructor(options) {
|
|
8689
|
+
super({ ...defaults$e, ...options });
|
|
8690
|
+
}
|
|
8686
8691
|
documentation(context) {
|
|
8687
8692
|
const { role, tagName } = context;
|
|
8688
8693
|
return {
|
|
@@ -8690,6 +8695,36 @@ class NoRedundantRole extends Rule {
|
|
|
8690
8695
|
url: "https://html-validate.org/rules/no-redundant-role.html"
|
|
8691
8696
|
};
|
|
8692
8697
|
}
|
|
8698
|
+
static schema() {
|
|
8699
|
+
return {
|
|
8700
|
+
exclude: {
|
|
8701
|
+
anyOf: [
|
|
8702
|
+
{
|
|
8703
|
+
items: {
|
|
8704
|
+
type: "string"
|
|
8705
|
+
},
|
|
8706
|
+
type: "array"
|
|
8707
|
+
},
|
|
8708
|
+
{
|
|
8709
|
+
type: "null"
|
|
8710
|
+
}
|
|
8711
|
+
]
|
|
8712
|
+
},
|
|
8713
|
+
include: {
|
|
8714
|
+
anyOf: [
|
|
8715
|
+
{
|
|
8716
|
+
items: {
|
|
8717
|
+
type: "string"
|
|
8718
|
+
},
|
|
8719
|
+
type: "array"
|
|
8720
|
+
},
|
|
8721
|
+
{
|
|
8722
|
+
type: "null"
|
|
8723
|
+
}
|
|
8724
|
+
]
|
|
8725
|
+
}
|
|
8726
|
+
};
|
|
8727
|
+
}
|
|
8693
8728
|
setup() {
|
|
8694
8729
|
this.on("tag:ready", (event) => {
|
|
8695
8730
|
const { target } = event;
|
|
@@ -8708,6 +8743,9 @@ class NoRedundantRole extends Rule {
|
|
|
8708
8743
|
if (role.value !== implicitRole) {
|
|
8709
8744
|
return;
|
|
8710
8745
|
}
|
|
8746
|
+
if (this.isKeywordIgnored(role.value)) {
|
|
8747
|
+
return;
|
|
8748
|
+
}
|
|
8711
8749
|
const context = {
|
|
8712
8750
|
tagName: target.tagName,
|
|
8713
8751
|
role: role.value
|
|
@@ -8901,7 +8939,7 @@ class NoUnusedDisable extends Rule {
|
|
|
8901
8939
|
const tokens = new DOMTokenList(options.replaceAll(",", " "), location);
|
|
8902
8940
|
for (const ruleId of unused) {
|
|
8903
8941
|
const index = tokens.indexOf(ruleId);
|
|
8904
|
-
const tokenLocation = index
|
|
8942
|
+
const tokenLocation = index !== -1 ? tokens.location(index) : location;
|
|
8905
8943
|
this.report({
|
|
8906
8944
|
node: null,
|
|
8907
8945
|
message: '"{{ ruleId }}" rule is disabled but no error was reported',
|
|
@@ -9149,7 +9187,7 @@ class PreferTbody extends Rule {
|
|
|
9149
9187
|
continue;
|
|
9150
9188
|
}
|
|
9151
9189
|
const tr = table.querySelectorAll("> tr");
|
|
9152
|
-
if (tr.length
|
|
9190
|
+
if (tr.length > 0) {
|
|
9153
9191
|
this.report(tr[0], "Prefer to wrap <tr> elements in <tbody>");
|
|
9154
9192
|
}
|
|
9155
9193
|
}
|
|
@@ -10933,7 +10971,7 @@ function isSimpleTable(table) {
|
|
|
10933
10971
|
}
|
|
10934
10972
|
const shape = getShape(cells);
|
|
10935
10973
|
const headersPerRow = cells.map((row) => row.reduce((sum, cell) => sum + cell, 0));
|
|
10936
|
-
const headersPerColumn = Array(shape.cols).fill(0).map((_, index) => {
|
|
10974
|
+
const headersPerColumn = new Array(shape.cols).fill(0).map((_, index) => {
|
|
10937
10975
|
return cells.reduce((sum, it) => sum + it[index], 0);
|
|
10938
10976
|
});
|
|
10939
10977
|
const [firstRow, ...otherRows] = headersPerRow;
|
|
@@ -12455,7 +12493,7 @@ class EventHandler {
|
|
|
12455
12493
|
}
|
|
12456
12494
|
|
|
12457
12495
|
const name = "html-validate";
|
|
12458
|
-
const version = "10.
|
|
12496
|
+
const version = "10.11.0";
|
|
12459
12497
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
12460
12498
|
|
|
12461
12499
|
function freeze(src) {
|