html-validate 10.7.0 → 10.9.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 +271 -23
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +6 -2
- package/dist/cjs/elements.js.map +1 -1
- package/dist/cjs/tsdoc-metadata.json +1 -1
- package/dist/esm/browser.js +1 -1
- package/dist/esm/cli.js +2 -2
- package/dist/esm/core-browser.js +1 -1
- package/dist/esm/core-nodejs.js +1 -1
- package/dist/esm/core.js +272 -24
- package/dist/esm/core.js.map +1 -1
- package/dist/esm/elements.js +6 -2
- package/dist/esm/elements.js.map +1 -1
- package/dist/esm/html-validate.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +1 -1
package/dist/esm/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { H as HtmlValidate, c as compatibilityCheck, e as esmResolver } from './core-browser.js';
|
|
2
|
-
export { A as Attribute, f as Config, e as ConfigError, C as ConfigLoader, D as DOMNode,
|
|
2
|
+
export { A as Attribute, f as Config, e as ConfigError, C as ConfigLoader, D as DOMNode, m as DOMTokenList, o as DOMTree, p as DynamicValue, q as EventHandler, H as HtmlElement, M as MetaCopyableProperty, r as MetaTable, N as NestedError, s as NodeClosed, u as NodeType, P as Parser, R as Reporter, w as ResolvedConfig, x as Rule, y as SchemaValidationError, z as Severity, S as StaticConfigLoader, T as TextClassification, B as TextContent, F as TextNode, U as UserError, V as Validator, W as WrappedError, G as ariaNaming, I as classifyNodeText, J as configPresets, K as defineConfig, L as definePlugin, O as isUserError, Q as keywordPatternMatcher, X as ruleExists, Y as sliceLocation, Z as staticResolver, v as version, _ as walk } from './core.js';
|
|
3
3
|
export { d as defineMetadata, m as metadataHelper } from './meta-helper.js';
|
|
4
4
|
import 'ajv';
|
|
5
5
|
import './elements.js';
|
package/dist/esm/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as legacyRequire, F as FileSystemConfigLoader,
|
|
2
|
-
import {
|
|
1
|
+
import { l as legacyRequire, F as FileSystemConfigLoader, H as HtmlValidate, e as esmResolver } from './core-nodejs.js';
|
|
2
|
+
import { U as UserError, h as ensureError, j as getFormatter$1, k as deepmerge, l as ignore, R as Reporter, $ as engines } from './core.js';
|
|
3
3
|
import path$1 from 'node:path/posix';
|
|
4
4
|
import fs from 'node:fs';
|
|
5
5
|
import path from 'node:path';
|
package/dist/esm/core-browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StaticConfigLoader,
|
|
1
|
+
import { S as StaticConfigLoader, t as transformSource, E as Engine, P as Parser, a as transformSourceSync, b as transformFilename, c as transformFilenameSync, R as Reporter, d as configurationSchema, i as isThenable, U as UserError, C as ConfigLoader, n as normalizeSource, g as compatibilityCheckImpl, v as version } from './core.js';
|
|
2
2
|
|
|
3
3
|
function isSourceHooks(value) {
|
|
4
4
|
if (!value || typeof value === "string") {
|
package/dist/esm/core-nodejs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs, { existsSync } from 'node:fs';
|
|
2
|
-
import { S as StaticConfigLoader,
|
|
2
|
+
import { S as StaticConfigLoader, t as transformSource, E as Engine, P as Parser, a as transformSourceSync, b as transformFilename, c as transformFilenameSync, R as Reporter, d as configurationSchema, i as isThenable, U as UserError, C as ConfigLoader, n as normalizeSource, e as ConfigError, f as Config, g as compatibilityCheckImpl, v as version } from './core.js';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import fs$1 from 'node:fs/promises';
|
|
5
5
|
import { pathToFileURL } from 'node:url';
|
package/dist/esm/core.js
CHANGED
|
@@ -3999,7 +3999,7 @@ class Rule {
|
|
|
3999
3999
|
}
|
|
4000
4000
|
}
|
|
4001
4001
|
|
|
4002
|
-
const defaults$
|
|
4002
|
+
const defaults$B = {
|
|
4003
4003
|
allowExternal: true,
|
|
4004
4004
|
allowRelative: true,
|
|
4005
4005
|
allowAbsolute: true,
|
|
@@ -4043,7 +4043,7 @@ class AllowedLinks extends Rule {
|
|
|
4043
4043
|
allowRelative;
|
|
4044
4044
|
allowAbsolute;
|
|
4045
4045
|
constructor(options) {
|
|
4046
|
-
super({ ...defaults$
|
|
4046
|
+
super({ ...defaults$B, ...options });
|
|
4047
4047
|
this.allowExternal = parseAllow(this.options.allowExternal);
|
|
4048
4048
|
this.allowRelative = parseAllow(this.options.allowRelative);
|
|
4049
4049
|
this.allowAbsolute = parseAllow(this.options.allowAbsolute);
|
|
@@ -4211,7 +4211,7 @@ class AllowedLinks extends Rule {
|
|
|
4211
4211
|
}
|
|
4212
4212
|
}
|
|
4213
4213
|
|
|
4214
|
-
const defaults$
|
|
4214
|
+
const defaults$A = {
|
|
4215
4215
|
accessible: true
|
|
4216
4216
|
};
|
|
4217
4217
|
function findByTarget(target, siblings) {
|
|
@@ -4241,7 +4241,7 @@ function getDescription$1(context) {
|
|
|
4241
4241
|
}
|
|
4242
4242
|
class AreaAlt extends Rule {
|
|
4243
4243
|
constructor(options) {
|
|
4244
|
-
super({ ...defaults$
|
|
4244
|
+
super({ ...defaults$A, ...options });
|
|
4245
4245
|
}
|
|
4246
4246
|
static schema() {
|
|
4247
4247
|
return {
|
|
@@ -4320,7 +4320,7 @@ class AriaHiddenBody extends Rule {
|
|
|
4320
4320
|
}
|
|
4321
4321
|
}
|
|
4322
4322
|
|
|
4323
|
-
const defaults$
|
|
4323
|
+
const defaults$z = {
|
|
4324
4324
|
allowAnyNamable: false,
|
|
4325
4325
|
elements: {
|
|
4326
4326
|
include: null,
|
|
@@ -4368,7 +4368,7 @@ function isValidUsage(target, meta) {
|
|
|
4368
4368
|
}
|
|
4369
4369
|
class AriaLabelMisuse extends Rule {
|
|
4370
4370
|
constructor(options) {
|
|
4371
|
-
super({ ...defaults$
|
|
4371
|
+
super({ ...defaults$z, ...options });
|
|
4372
4372
|
}
|
|
4373
4373
|
static schema() {
|
|
4374
4374
|
return {
|
|
@@ -4537,14 +4537,14 @@ class CaseStyle {
|
|
|
4537
4537
|
}
|
|
4538
4538
|
}
|
|
4539
4539
|
|
|
4540
|
-
const defaults$
|
|
4540
|
+
const defaults$y = {
|
|
4541
4541
|
style: "lowercase",
|
|
4542
4542
|
ignoreForeign: true
|
|
4543
4543
|
};
|
|
4544
4544
|
class AttrCase extends Rule {
|
|
4545
4545
|
style;
|
|
4546
4546
|
constructor(options) {
|
|
4547
|
-
super({ ...defaults$
|
|
4547
|
+
super({ ...defaults$y, ...options });
|
|
4548
4548
|
this.style = new CaseStyle(this.options.style, "attr-case");
|
|
4549
4549
|
}
|
|
4550
4550
|
static schema() {
|
|
@@ -4949,7 +4949,7 @@ class AttrDelimiter extends Rule {
|
|
|
4949
4949
|
}
|
|
4950
4950
|
|
|
4951
4951
|
const DEFAULT_PATTERN = "[a-z0-9-:]+";
|
|
4952
|
-
const defaults$
|
|
4952
|
+
const defaults$x = {
|
|
4953
4953
|
pattern: DEFAULT_PATTERN,
|
|
4954
4954
|
ignoreForeign: true
|
|
4955
4955
|
};
|
|
@@ -4982,7 +4982,7 @@ function generateDescription(name, pattern) {
|
|
|
4982
4982
|
class AttrPattern extends Rule {
|
|
4983
4983
|
pattern;
|
|
4984
4984
|
constructor(options) {
|
|
4985
|
-
super({ ...defaults$
|
|
4985
|
+
super({ ...defaults$x, ...options });
|
|
4986
4986
|
this.pattern = generateRegexp(this.options.pattern);
|
|
4987
4987
|
}
|
|
4988
4988
|
static schema() {
|
|
@@ -5029,7 +5029,7 @@ class AttrPattern extends Rule {
|
|
|
5029
5029
|
}
|
|
5030
5030
|
}
|
|
5031
5031
|
|
|
5032
|
-
const defaults$
|
|
5032
|
+
const defaults$w = {
|
|
5033
5033
|
style: "auto",
|
|
5034
5034
|
unquoted: false
|
|
5035
5035
|
};
|
|
@@ -5095,7 +5095,7 @@ class AttrQuotes extends Rule {
|
|
|
5095
5095
|
};
|
|
5096
5096
|
}
|
|
5097
5097
|
constructor(options) {
|
|
5098
|
-
super({ ...defaults$
|
|
5098
|
+
super({ ...defaults$w, ...options });
|
|
5099
5099
|
this.style = parseStyle$3(this.options.style);
|
|
5100
5100
|
}
|
|
5101
5101
|
setup() {
|
|
@@ -5251,13 +5251,13 @@ class AttributeAllowedValues extends Rule {
|
|
|
5251
5251
|
}
|
|
5252
5252
|
}
|
|
5253
5253
|
|
|
5254
|
-
const defaults$
|
|
5254
|
+
const defaults$v = {
|
|
5255
5255
|
style: "omit"
|
|
5256
5256
|
};
|
|
5257
5257
|
class AttributeBooleanStyle extends Rule {
|
|
5258
5258
|
hasInvalidStyle;
|
|
5259
5259
|
constructor(options) {
|
|
5260
|
-
super({ ...defaults$
|
|
5260
|
+
super({ ...defaults$v, ...options });
|
|
5261
5261
|
this.hasInvalidStyle = parseStyle$2(this.options.style);
|
|
5262
5262
|
}
|
|
5263
5263
|
static schema() {
|
|
@@ -5327,13 +5327,13 @@ function reportMessage$1(attr, style) {
|
|
|
5327
5327
|
return "";
|
|
5328
5328
|
}
|
|
5329
5329
|
|
|
5330
|
-
const defaults$
|
|
5330
|
+
const defaults$u = {
|
|
5331
5331
|
style: "omit"
|
|
5332
5332
|
};
|
|
5333
5333
|
class AttributeEmptyStyle extends Rule {
|
|
5334
5334
|
hasInvalidStyle;
|
|
5335
5335
|
constructor(options) {
|
|
5336
|
-
super({ ...defaults$
|
|
5336
|
+
super({ ...defaults$u, ...options });
|
|
5337
5337
|
this.hasInvalidStyle = parseStyle$1(this.options.style);
|
|
5338
5338
|
}
|
|
5339
5339
|
static schema() {
|
|
@@ -5450,6 +5450,122 @@ class AttributeMisuse extends Rule {
|
|
|
5450
5450
|
}
|
|
5451
5451
|
}
|
|
5452
5452
|
|
|
5453
|
+
const defaults$t = {
|
|
5454
|
+
preferred: void 0
|
|
5455
|
+
};
|
|
5456
|
+
function isPasswordInput(event) {
|
|
5457
|
+
const { target } = event;
|
|
5458
|
+
if (!target.is("input")) {
|
|
5459
|
+
return false;
|
|
5460
|
+
}
|
|
5461
|
+
const type = target.getAttribute("type");
|
|
5462
|
+
return type?.value?.toString().toLowerCase() === "password";
|
|
5463
|
+
}
|
|
5464
|
+
function isGroupingToken(token) {
|
|
5465
|
+
return token.startsWith("section-") || token === "shipping" || token === "billing";
|
|
5466
|
+
}
|
|
5467
|
+
class AutocompletePassword extends Rule {
|
|
5468
|
+
preferred;
|
|
5469
|
+
constructor(options) {
|
|
5470
|
+
super({ ...defaults$t, ...options });
|
|
5471
|
+
this.preferred = options.preferred?.toLowerCase();
|
|
5472
|
+
}
|
|
5473
|
+
static schema() {
|
|
5474
|
+
return {
|
|
5475
|
+
preferred: {
|
|
5476
|
+
type: "string"
|
|
5477
|
+
}
|
|
5478
|
+
};
|
|
5479
|
+
}
|
|
5480
|
+
documentation(context) {
|
|
5481
|
+
const url = "https://html-validate.org/rules/autocomplete-password.html";
|
|
5482
|
+
switch (context.kind) {
|
|
5483
|
+
case "preferred-mismatch":
|
|
5484
|
+
return {
|
|
5485
|
+
description: [
|
|
5486
|
+
`\`<input type="password">\` should use \`autocomplete="${context.preferred}"\`.`,
|
|
5487
|
+
"",
|
|
5488
|
+
`The configured preferred autocomplete value is \`"${context.preferred}"\` but the element uses \`"${context.value}"\`.`
|
|
5489
|
+
].join("\n"),
|
|
5490
|
+
url
|
|
5491
|
+
};
|
|
5492
|
+
case "off":
|
|
5493
|
+
case "missing":
|
|
5494
|
+
default: {
|
|
5495
|
+
const error = context.kind === "off" ? '`<input type="password">` should not use `autocomplete="off"`.' : '`<input type="password">` must have the `autocomplete` attribute.';
|
|
5496
|
+
return {
|
|
5497
|
+
description: [
|
|
5498
|
+
error,
|
|
5499
|
+
"",
|
|
5500
|
+
"Browsers and password managers often ignore the absence of autocomplete and autofill password fields anyway, which can lead to unexpected behavior where users unknowingly submit autofilled passwords for unrelated fields.",
|
|
5501
|
+
"",
|
|
5502
|
+
"Use one of the following values:",
|
|
5503
|
+
"",
|
|
5504
|
+
'- `autocomplete="new-password"` for password creation forms',
|
|
5505
|
+
'- `autocomplete="current-password"` for login forms'
|
|
5506
|
+
].join("\n"),
|
|
5507
|
+
url
|
|
5508
|
+
};
|
|
5509
|
+
}
|
|
5510
|
+
}
|
|
5511
|
+
}
|
|
5512
|
+
setup() {
|
|
5513
|
+
this.on("tag:ready", isPasswordInput, (event) => {
|
|
5514
|
+
const { preferred } = this;
|
|
5515
|
+
const { target } = event;
|
|
5516
|
+
const autocomplete = target.getAttribute("autocomplete");
|
|
5517
|
+
if (!autocomplete) {
|
|
5518
|
+
const context = { kind: "missing" };
|
|
5519
|
+
this.report({
|
|
5520
|
+
node: target,
|
|
5521
|
+
message: '<input type="password"> is missing required "autocomplete" attribute',
|
|
5522
|
+
location: target.location,
|
|
5523
|
+
context
|
|
5524
|
+
});
|
|
5525
|
+
return;
|
|
5526
|
+
}
|
|
5527
|
+
if (autocomplete.isDynamic || !autocomplete.value) {
|
|
5528
|
+
return;
|
|
5529
|
+
}
|
|
5530
|
+
const raw = autocomplete.value.toString().toLowerCase();
|
|
5531
|
+
const tokens = new DOMTokenList(raw, autocomplete.valueLocation);
|
|
5532
|
+
const index = tokens.findIndex((token) => !isGroupingToken(token));
|
|
5533
|
+
const value = tokens.item(index);
|
|
5534
|
+
const location = tokens.location(index);
|
|
5535
|
+
if (!value) {
|
|
5536
|
+
return;
|
|
5537
|
+
}
|
|
5538
|
+
if (value === "off") {
|
|
5539
|
+
const context = { kind: "off" };
|
|
5540
|
+
this.report({
|
|
5541
|
+
node: target,
|
|
5542
|
+
message: '<input type="password"> should not use autocomplete="off"',
|
|
5543
|
+
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- location must be present if value is */
|
|
5544
|
+
location,
|
|
5545
|
+
context
|
|
5546
|
+
});
|
|
5547
|
+
return;
|
|
5548
|
+
}
|
|
5549
|
+
if (preferred) {
|
|
5550
|
+
if (value !== preferred) {
|
|
5551
|
+
const context = {
|
|
5552
|
+
kind: "preferred-mismatch",
|
|
5553
|
+
value,
|
|
5554
|
+
preferred
|
|
5555
|
+
};
|
|
5556
|
+
this.report({
|
|
5557
|
+
node: target,
|
|
5558
|
+
message: `<input type="password"> should use autocomplete="${preferred}"`,
|
|
5559
|
+
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- location must be present if value is */
|
|
5560
|
+
location,
|
|
5561
|
+
context
|
|
5562
|
+
});
|
|
5563
|
+
}
|
|
5564
|
+
}
|
|
5565
|
+
});
|
|
5566
|
+
}
|
|
5567
|
+
}
|
|
5568
|
+
|
|
5453
5569
|
const patternNamesValues = [
|
|
5454
5570
|
"kebabcase",
|
|
5455
5571
|
"camelcase",
|
|
@@ -5581,7 +5697,7 @@ class BasePatternRule extends Rule {
|
|
|
5581
5697
|
}
|
|
5582
5698
|
}
|
|
5583
5699
|
|
|
5584
|
-
const defaults$
|
|
5700
|
+
const defaults$s = {
|
|
5585
5701
|
pattern: "kebabcase"
|
|
5586
5702
|
};
|
|
5587
5703
|
class ClassPattern extends BasePatternRule {
|
|
@@ -5589,7 +5705,7 @@ class ClassPattern extends BasePatternRule {
|
|
|
5589
5705
|
super({
|
|
5590
5706
|
ruleId: "class-pattern",
|
|
5591
5707
|
attr: "class",
|
|
5592
|
-
options: { ...defaults$
|
|
5708
|
+
options: { ...defaults$s, ...options },
|
|
5593
5709
|
allowedPatterns: patternNames
|
|
5594
5710
|
// allow all patterns
|
|
5595
5711
|
});
|
|
@@ -5739,13 +5855,13 @@ class CloseOrder extends Rule {
|
|
|
5739
5855
|
}
|
|
5740
5856
|
}
|
|
5741
5857
|
|
|
5742
|
-
const defaults$
|
|
5858
|
+
const defaults$r = {
|
|
5743
5859
|
include: null,
|
|
5744
5860
|
exclude: null
|
|
5745
5861
|
};
|
|
5746
5862
|
class Deprecated extends Rule {
|
|
5747
5863
|
constructor(options) {
|
|
5748
|
-
super({ ...defaults$
|
|
5864
|
+
super({ ...defaults$r, ...options });
|
|
5749
5865
|
}
|
|
5750
5866
|
static schema() {
|
|
5751
5867
|
return {
|
|
@@ -5853,6 +5969,137 @@ function prettySource(source) {
|
|
|
5853
5969
|
}
|
|
5854
5970
|
}
|
|
5855
5971
|
|
|
5972
|
+
function quote(value, char = '"') {
|
|
5973
|
+
return `${char}${value}${char}`;
|
|
5974
|
+
}
|
|
5975
|
+
|
|
5976
|
+
const defaults$q = {
|
|
5977
|
+
classes: []
|
|
5978
|
+
};
|
|
5979
|
+
function isRelevant$6(event) {
|
|
5980
|
+
return event.key.toLowerCase() === "class";
|
|
5981
|
+
}
|
|
5982
|
+
function normalizeEntry(entry) {
|
|
5983
|
+
const { class: className, message, replacement = [], url } = entry;
|
|
5984
|
+
return {
|
|
5985
|
+
class: className,
|
|
5986
|
+
message,
|
|
5987
|
+
replacement: Array.isArray(replacement) ? replacement : [replacement],
|
|
5988
|
+
url
|
|
5989
|
+
};
|
|
5990
|
+
}
|
|
5991
|
+
function formatDeprecatedMessage(className, entry) {
|
|
5992
|
+
let message = `class "${className}" is deprecated`;
|
|
5993
|
+
if (entry.replacement.length > 0) {
|
|
5994
|
+
const joined = naturalJoin(
|
|
5995
|
+
entry.replacement.map((r) => quote(r)),
|
|
5996
|
+
"or"
|
|
5997
|
+
);
|
|
5998
|
+
message += ` and replaced with ${joined}`;
|
|
5999
|
+
}
|
|
6000
|
+
if (entry.message) {
|
|
6001
|
+
message += `: ${entry.message}`;
|
|
6002
|
+
}
|
|
6003
|
+
return message;
|
|
6004
|
+
}
|
|
6005
|
+
function formatDocumentationDescription(context) {
|
|
6006
|
+
const text = [];
|
|
6007
|
+
const className = context.class;
|
|
6008
|
+
let description = `The class \`${className}\` is deprecated and should not be used`;
|
|
6009
|
+
if (context.message) {
|
|
6010
|
+
description += `: ${context.message}.`;
|
|
6011
|
+
} else {
|
|
6012
|
+
description += ".";
|
|
6013
|
+
}
|
|
6014
|
+
text.push(description);
|
|
6015
|
+
if (context.replacement.length === 1) {
|
|
6016
|
+
text.push(`Use the replacement class ${quote(context.replacement[0], "`")} instead.`);
|
|
6017
|
+
} else if (context.replacement.length > 1) {
|
|
6018
|
+
const listItems = context.replacement.map((r) => `- ${quote(r, "`")}`);
|
|
6019
|
+
text.push(`Use one of the following replacement classes instead:
|
|
6020
|
+
${listItems.join("\n")}`);
|
|
6021
|
+
}
|
|
6022
|
+
if (context.url) {
|
|
6023
|
+
text.push(`For details see: ${context.url}`);
|
|
6024
|
+
}
|
|
6025
|
+
return text.join("\n\n");
|
|
6026
|
+
}
|
|
6027
|
+
class DeprecatedClass extends Rule {
|
|
6028
|
+
deprecatedMap;
|
|
6029
|
+
constructor(options) {
|
|
6030
|
+
super({ ...defaults$q, ...options });
|
|
6031
|
+
const { classes } = this.options;
|
|
6032
|
+
this.deprecatedMap = new Map(classes.map((entry) => [entry.class, normalizeEntry(entry)]));
|
|
6033
|
+
}
|
|
6034
|
+
static schema() {
|
|
6035
|
+
return {
|
|
6036
|
+
classes: {
|
|
6037
|
+
type: "array",
|
|
6038
|
+
items: {
|
|
6039
|
+
type: "object",
|
|
6040
|
+
properties: {
|
|
6041
|
+
class: {
|
|
6042
|
+
type: "string"
|
|
6043
|
+
},
|
|
6044
|
+
message: {
|
|
6045
|
+
type: "string"
|
|
6046
|
+
},
|
|
6047
|
+
replacement: {
|
|
6048
|
+
anyOf: [
|
|
6049
|
+
{
|
|
6050
|
+
type: "string"
|
|
6051
|
+
},
|
|
6052
|
+
{
|
|
6053
|
+
type: "array",
|
|
6054
|
+
items: {
|
|
6055
|
+
type: "string"
|
|
6056
|
+
}
|
|
6057
|
+
}
|
|
6058
|
+
]
|
|
6059
|
+
},
|
|
6060
|
+
url: {
|
|
6061
|
+
type: "string"
|
|
6062
|
+
}
|
|
6063
|
+
},
|
|
6064
|
+
required: ["class"],
|
|
6065
|
+
additionalProperties: false
|
|
6066
|
+
}
|
|
6067
|
+
}
|
|
6068
|
+
};
|
|
6069
|
+
}
|
|
6070
|
+
documentation(context) {
|
|
6071
|
+
return {
|
|
6072
|
+
description: formatDocumentationDescription(context),
|
|
6073
|
+
url: "https://html-validate.org/rules/deprecated-class.html"
|
|
6074
|
+
};
|
|
6075
|
+
}
|
|
6076
|
+
setup() {
|
|
6077
|
+
this.on("attr", isRelevant$6, (event) => {
|
|
6078
|
+
const { value, valueLocation, target } = event;
|
|
6079
|
+
const classes = new DOMTokenList(value, valueLocation);
|
|
6080
|
+
for (const { item, location } of classes.iterator()) {
|
|
6081
|
+
const deprecatedEntry = this.deprecatedMap.get(item);
|
|
6082
|
+
if (!deprecatedEntry) {
|
|
6083
|
+
continue;
|
|
6084
|
+
}
|
|
6085
|
+
const message = formatDeprecatedMessage(item, deprecatedEntry);
|
|
6086
|
+
const context = {
|
|
6087
|
+
class: item,
|
|
6088
|
+
message: deprecatedEntry.message ?? null,
|
|
6089
|
+
replacement: deprecatedEntry.replacement,
|
|
6090
|
+
url: deprecatedEntry.url ?? null
|
|
6091
|
+
};
|
|
6092
|
+
this.report({
|
|
6093
|
+
node: target,
|
|
6094
|
+
message,
|
|
6095
|
+
location,
|
|
6096
|
+
context
|
|
6097
|
+
});
|
|
6098
|
+
}
|
|
6099
|
+
});
|
|
6100
|
+
}
|
|
6101
|
+
}
|
|
6102
|
+
|
|
5856
6103
|
class DeprecatedRule extends Rule {
|
|
5857
6104
|
documentation(context) {
|
|
5858
6105
|
const preamble = context ? `The rule "${context}"` : "This rule";
|
|
@@ -9746,9 +9993,7 @@ const fieldNameGroup = {
|
|
|
9746
9993
|
nickname: "text",
|
|
9747
9994
|
username: "username",
|
|
9748
9995
|
"new-password": "password",
|
|
9749
|
-
// eslint-disable-line sonarjs/no-hardcoded-passwords -- false positive, it is not used as a password
|
|
9750
9996
|
"current-password": "password",
|
|
9751
|
-
// eslint-disable-line sonarjs/no-hardcoded-passwords -- false positive, it is not used as a password
|
|
9752
9997
|
"one-time-code": "password",
|
|
9753
9998
|
"organization-title": "text",
|
|
9754
9999
|
organization: "text",
|
|
@@ -10790,10 +11035,12 @@ const bundledRules = {
|
|
|
10790
11035
|
"attribute-boolean-style": AttributeBooleanStyle,
|
|
10791
11036
|
"attribute-empty-style": AttributeEmptyStyle,
|
|
10792
11037
|
"attribute-misuse": AttributeMisuse,
|
|
11038
|
+
"autocomplete-password": AutocompletePassword,
|
|
10793
11039
|
"class-pattern": ClassPattern,
|
|
10794
11040
|
"close-attr": CloseAttr,
|
|
10795
11041
|
"close-order": CloseOrder,
|
|
10796
11042
|
deprecated: Deprecated,
|
|
11043
|
+
"deprecated-class": DeprecatedClass,
|
|
10797
11044
|
"deprecated-rule": DeprecatedRule,
|
|
10798
11045
|
"doctype-html": NoStyleTag$1,
|
|
10799
11046
|
"doctype-style": DoctypeStyle,
|
|
@@ -11155,6 +11402,7 @@ const config$1 = {
|
|
|
11155
11402
|
"attribute-boolean-style": "error",
|
|
11156
11403
|
"attribute-empty-style": "error",
|
|
11157
11404
|
"attribute-misuse": "error",
|
|
11405
|
+
"autocomplete-password": "error",
|
|
11158
11406
|
"close-attr": "error",
|
|
11159
11407
|
"close-order": "error",
|
|
11160
11408
|
deprecated: "error",
|
|
@@ -12169,7 +12417,7 @@ class EventHandler {
|
|
|
12169
12417
|
}
|
|
12170
12418
|
|
|
12171
12419
|
const name = "html-validate";
|
|
12172
|
-
const version = "10.
|
|
12420
|
+
const version = "10.9.0";
|
|
12173
12421
|
const bugs = "https://gitlab.com/html-validate/html-validate/issues/new";
|
|
12174
12422
|
|
|
12175
12423
|
function freeze(src) {
|
|
@@ -14589,5 +14837,5 @@ const engines = {
|
|
|
14589
14837
|
|
|
14590
14838
|
var workerPath = "./jest-worker.js";
|
|
14591
14839
|
|
|
14592
|
-
export { engines as $, Attribute as A,
|
|
14840
|
+
export { engines as $, Attribute as A, TextContent$1 as B, ConfigLoader as C, DOMNode as D, Engine as E, TextNode as F, ariaNaming as G, HtmlElement as H, classifyNodeText as I, presets as J, defineConfig as K, definePlugin as L, MetaCopyableProperty as M, NestedError as N, isUserError as O, Parser as P, keywordPatternMatcher as Q, Reporter as R, StaticConfigLoader as S, TextClassification as T, UserError as U, Validator as V, WrappedError as W, ruleExists as X, sliceLocation as Y, staticResolver as Z, walk as _, transformSourceSync as a, workerPath as a0, codeframe as a1, name as a2, bugs as a3, transformFilename as b, transformFilenameSync as c, configurationSchema as d, ConfigError as e, Config as f, compatibilityCheckImpl as g, ensureError as h, isThenable as i, getFormatter as j, deepmerge as k, ignore as l, DOMTokenList as m, normalizeSource as n, DOMTree as o, DynamicValue as p, EventHandler as q, MetaTable as r, NodeClosed as s, transformSource as t, NodeType as u, version as v, ResolvedConfig as w, Rule as x, SchemaValidationError as y, Severity as z };
|
|
14593
14841
|
//# sourceMappingURL=core.js.map
|