@markuplint/rules 3.11.0 → 3.12.1
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/lib/index.d.ts
CHANGED
|
@@ -15,38 +15,38 @@ declare const rules: {
|
|
|
15
15
|
readonly 'id-duplication': Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
|
|
16
16
|
readonly 'ineffective-attr': Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
|
|
17
17
|
readonly 'invalid-attr': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, {
|
|
18
|
-
allowAttrs?:
|
|
19
|
-
enum: [string, ...string[]];
|
|
20
|
-
} | {
|
|
21
|
-
pattern: string;
|
|
22
|
-
} | {
|
|
23
|
-
type: import("packages/@markuplint/ml-spec/lib").AttributeType;
|
|
24
|
-
}> | (string | {
|
|
18
|
+
allowAttrs?: (string | {
|
|
25
19
|
name: string;
|
|
26
|
-
value:
|
|
20
|
+
value: ({
|
|
27
21
|
enum: [string, ...string[]];
|
|
28
22
|
} | {
|
|
29
23
|
pattern: string;
|
|
30
24
|
} | {
|
|
31
25
|
type: import("packages/@markuplint/ml-spec/lib").AttributeType;
|
|
32
|
-
});
|
|
33
|
-
})[] |
|
|
34
|
-
disallowAttrs?: Record<string, {
|
|
26
|
+
}) | import("packages/@markuplint/ml-spec/lib").AttributeType;
|
|
27
|
+
})[] | Record<string, {
|
|
35
28
|
enum: [string, ...string[]];
|
|
36
29
|
} | {
|
|
37
30
|
pattern: string;
|
|
38
31
|
} | {
|
|
39
32
|
type: import("packages/@markuplint/ml-spec/lib").AttributeType;
|
|
40
|
-
}> |
|
|
33
|
+
}> | undefined;
|
|
34
|
+
disallowAttrs?: (string | {
|
|
41
35
|
name: string;
|
|
42
|
-
value:
|
|
36
|
+
value: ({
|
|
43
37
|
enum: [string, ...string[]];
|
|
44
38
|
} | {
|
|
45
39
|
pattern: string;
|
|
46
40
|
} | {
|
|
47
41
|
type: import("packages/@markuplint/ml-spec/lib").AttributeType;
|
|
48
|
-
});
|
|
49
|
-
})[] |
|
|
42
|
+
}) | import("packages/@markuplint/ml-spec/lib").AttributeType;
|
|
43
|
+
})[] | Record<string, {
|
|
44
|
+
enum: [string, ...string[]];
|
|
45
|
+
} | {
|
|
46
|
+
pattern: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: import("packages/@markuplint/ml-spec/lib").AttributeType;
|
|
49
|
+
}> | undefined;
|
|
50
50
|
ignoreAttrNamePrefix?: string | string[] | undefined;
|
|
51
51
|
allowToAddPropertiesForPretender?: boolean | undefined;
|
|
52
52
|
attrs?: Record<string, ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/rules",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.1",
|
|
4
4
|
"description": "Built-in rules of markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"./lib/permitted-contents/debug.js": "./lib/permitted-contents/debug.browser.js"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@markuplint/html-spec": "3.
|
|
24
|
-
"@markuplint/ml-core": "3.
|
|
25
|
-
"@markuplint/ml-spec": "3.
|
|
26
|
-
"@markuplint/selector": "3.
|
|
27
|
-
"@markuplint/shared": "3.
|
|
28
|
-
"@markuplint/types": "3.
|
|
23
|
+
"@markuplint/html-spec": "3.11.1",
|
|
24
|
+
"@markuplint/ml-core": "3.12.1",
|
|
25
|
+
"@markuplint/ml-spec": "3.11.1",
|
|
26
|
+
"@markuplint/selector": "3.11.1",
|
|
27
|
+
"@markuplint/shared": "3.8.0",
|
|
28
|
+
"@markuplint/types": "3.9.1",
|
|
29
29
|
"@types/debug": "^4.1.8",
|
|
30
30
|
"@ungap/structured-clone": "^1.2.0",
|
|
31
31
|
"ansi-colors": "^4.1.3",
|
|
32
|
-
"chrono-node": "^2.6.
|
|
32
|
+
"chrono-node": "^2.6.6",
|
|
33
33
|
"debug": "^4.3.4",
|
|
34
|
-
"tslib": "^2.
|
|
35
|
-
"type-fest": "^3.
|
|
34
|
+
"tslib": "^2.6.2",
|
|
35
|
+
"type-fest": "^4.3.1"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "09100b8baa14dd930602daa458197322197c79c2"
|
|
38
38
|
}
|
|
@@ -1629,4 +1629,13 @@ ol(itemscope itemtype="https://schema.org/BreadcrumbList")
|
|
|
1629
1629
|
).violations,
|
|
1630
1630
|
).toStrictEqual([]);
|
|
1631
1631
|
});
|
|
1632
|
+
|
|
1633
|
+
test('#1078', async () => {
|
|
1634
|
+
expect(
|
|
1635
|
+
(await mlRuleTest(rule, '<script src="foo.js" referrerpolicy="no-referrer"></script>')).violations,
|
|
1636
|
+
).toStrictEqual([]);
|
|
1637
|
+
expect(
|
|
1638
|
+
(await mlRuleTest(rule, '<img src="foo.png" referrerpolicy="no-referrer"></img>')).violations,
|
|
1639
|
+
).toStrictEqual([]);
|
|
1640
|
+
});
|
|
1632
1641
|
});
|
|
@@ -392,22 +392,7 @@ describe('Issues', () => {
|
|
|
392
392
|
test('#592', async () => {
|
|
393
393
|
expect(
|
|
394
394
|
(await mlRuleTest(rule, '<svg aria-label="i-have-name"><path /><rect><path /></rect></svg>')).violations,
|
|
395
|
-
).toStrictEqual([
|
|
396
|
-
{
|
|
397
|
-
col: 31,
|
|
398
|
-
line: 1,
|
|
399
|
-
message: 'Require accessible name',
|
|
400
|
-
raw: '<path />',
|
|
401
|
-
severity: 'error',
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
col: 39,
|
|
405
|
-
line: 1,
|
|
406
|
-
message: 'Require accessible name',
|
|
407
|
-
raw: '<rect>',
|
|
408
|
-
severity: 'error',
|
|
409
|
-
},
|
|
410
|
-
]);
|
|
395
|
+
).toStrictEqual([]);
|
|
411
396
|
expect(
|
|
412
397
|
(await mlRuleTest(rule, '<svg role="img" aria-label="i-have-name"><path /><rect><path /></rect></svg>'))
|
|
413
398
|
.violations,
|
|
@@ -419,15 +404,7 @@ describe('Issues', () => {
|
|
|
419
404
|
'<svg aria-label="i-have-name"><path aria-label="i-have-name" /><rect><path /></rect></svg>',
|
|
420
405
|
)
|
|
421
406
|
).violations,
|
|
422
|
-
).toStrictEqual([
|
|
423
|
-
{
|
|
424
|
-
col: 64,
|
|
425
|
-
line: 1,
|
|
426
|
-
message: 'Require accessible name',
|
|
427
|
-
raw: '<rect>',
|
|
428
|
-
severity: 'error',
|
|
429
|
-
},
|
|
430
|
-
]);
|
|
407
|
+
).toStrictEqual([]);
|
|
431
408
|
expect(
|
|
432
409
|
(
|
|
433
410
|
await mlRuleTest(
|
|
@@ -1170,4 +1170,34 @@ describe('Issues', () => {
|
|
|
1170
1170
|
},
|
|
1171
1171
|
]);
|
|
1172
1172
|
});
|
|
1173
|
+
|
|
1174
|
+
test('#1084', async () => {
|
|
1175
|
+
const { violations } = await mlRuleTest(
|
|
1176
|
+
rule,
|
|
1177
|
+
`
|
|
1178
|
+
<select multiple aria-label="some label text">
|
|
1179
|
+
<option>foo</option>
|
|
1180
|
+
<option>bar</option>
|
|
1181
|
+
</select>
|
|
1182
|
+
|
|
1183
|
+
<select aria-label="some label text">
|
|
1184
|
+
<option>foo</option>
|
|
1185
|
+
<option>bar</option>
|
|
1186
|
+
</select>
|
|
1187
|
+
|
|
1188
|
+
<select aria-label="some label text">
|
|
1189
|
+
<option>foo</option>
|
|
1190
|
+
<optgroup label="group">
|
|
1191
|
+
<option>bar</option>
|
|
1192
|
+
</optgroup>
|
|
1193
|
+
</select>
|
|
1194
|
+
|
|
1195
|
+
<datalist>
|
|
1196
|
+
<option>foo</option>
|
|
1197
|
+
<option>bar</option>
|
|
1198
|
+
</datalist>
|
|
1199
|
+
`,
|
|
1200
|
+
);
|
|
1201
|
+
expect(violations).toStrictEqual([]);
|
|
1202
|
+
});
|
|
1173
1203
|
});
|