@markuplint/rules 3.8.0 → 3.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/lib/helpers.d.ts +2 -5
- package/lib/index.d.ts +240 -99
- package/lib/permitted-contents/utils.d.ts +90 -41
- package/lib/wai-aria/checkings/_.d.ts +12 -6
- package/lib/wai-aria/checkings/disallowed-prop.d.ts +8 -4
- package/lib/wai-aria/checkings/required-prop copy.d.ts +12 -6
- package/lib/wai-aria/checkings/unadopted-explicit-roles.d.ts +12 -6
- package/lib/xxx/index.d.ts +2 -0
- package/lib/xxx/index.js +32 -0
- package/package.json +11 -13
- package/test/attr-check.spec.js +77 -0
- package/test/attr-duplication/index.spec.js +159 -0
- package/test/attr-value-quotes/index.spec.js +133 -0
- package/test/case-sensitive-attr-name/index.spec.js +65 -0
- package/test/case-sensitive-tag-name/index.spec.js +80 -0
- package/test/character-reference/index.spec.js +57 -0
- package/test/class-naming/index.spec.js +470 -0
- package/test/create-message.spec.js +497 -0
- package/test/deprecated-attr/index.spec.js +48 -0
- package/test/deprecated-element/index.spec.js +48 -0
- package/test/disallowed-element/index.spec.js +90 -0
- package/test/doctype/index.spec.js +50 -0
- package/test/end-tag/index.spec.js +162 -0
- package/test/id-duplication/index.spec.js +47 -0
- package/test/ineffective-attr/index.spec.js +31 -0
- package/test/invalid-attr/index.spec.js +1632 -0
- package/test/label-has-control/index.spec.js +29 -0
- package/test/landmark-roles/index.spec.js +187 -0
- package/test/no-boolean-attr-value/index.spec.js +41 -0
- package/test/no-default-value/index.spec.js +74 -0
- package/test/no-empty-palpable-content/index.spec.js +115 -0
- package/test/no-hard-code-id/index.spec.js +100 -0
- package/test/no-refer-to-non-existent-id/index.spec.js +254 -0
- package/test/no-use-event-handler-attr/index.spec.js +57 -0
- package/test/permitted-contents/choice.spec.js +174 -0
- package/test/permitted-contents/count-pattern.spec.js +308 -0
- package/test/permitted-contents/index.spec.js +1371 -0
- package/test/permitted-contents/matches-selector.spec.js +59 -0
- package/test/permitted-contents/order.spec.js +351 -0
- package/test/permitted-contents/recursive-branch.spec.js +41 -0
- package/test/permitted-contents/represent-transparent-nodes.spec.js +24 -0
- package/test/permitted-contents/start.spec.js +67 -0
- package/test/placeholder-label-option/index.spec.js +113 -0
- package/test/require-accessible-name/index.spec.js +446 -0
- package/test/require-datetime/index.spec.js +54 -0
- package/test/require-datetime/utils.spec.js +52 -0
- package/test/required-attr/index.spec.js +414 -0
- package/test/required-element/index.spec.js +188 -0
- package/test/required-h1/index.spec.js +69 -0
- package/test/use-list/index.spec.js +109 -0
- package/test/wai-aria/checkings/value.spec.js +33 -0
- package/test/wai-aria/index.spec.js +1173 -0
package/lib/helpers.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Translator } from '@markuplint/i18n';
|
|
|
3
3
|
import type { PlainData } from '@markuplint/ml-config';
|
|
4
4
|
import type { Element, RuleConfigValue, Document } from '@markuplint/ml-core';
|
|
5
5
|
import type { Attribute } from '@markuplint/ml-spec';
|
|
6
|
+
import type { WritableDeep } from 'type-fest';
|
|
6
7
|
export declare function attrMatches<T extends RuleConfigValue, O extends PlainData>(
|
|
7
8
|
node: Element<T, O>,
|
|
8
9
|
condition: Attribute['condition'],
|
|
@@ -58,8 +59,4 @@ export declare class Collection<T> {
|
|
|
58
59
|
add(...items: readonly (T | null | undefined)[]): void;
|
|
59
60
|
toArray(): readonly T[];
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
-
-readonly [P in keyof T]: T[P];
|
|
63
|
-
};
|
|
64
|
-
export declare function deepCopy<T>(value: T): Writeable<T>;
|
|
65
|
-
export {};
|
|
62
|
+
export declare function deepCopy<T>(value: T): WritableDeep<T>;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,102 +1,243 @@
|
|
|
1
1
|
declare const rules: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
2
|
+
readonly 'attr-duplication': Readonly<
|
|
3
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
4
|
+
>;
|
|
5
|
+
readonly 'attr-value-quotes': Readonly<
|
|
6
|
+
import('@markuplint/ml-core').RuleSeed<import('./attr-value-quotes').Type, undefined>
|
|
7
|
+
>;
|
|
8
|
+
readonly 'case-sensitive-attr-name': Readonly<
|
|
9
|
+
import('@markuplint/ml-core').RuleSeed<import('./case-sensitive-attr-name').Value, undefined>
|
|
10
|
+
>;
|
|
11
|
+
readonly 'case-sensitive-tag-name': Readonly<
|
|
12
|
+
import('@markuplint/ml-core').RuleSeed<import('./case-sensitive-tag-name').Value, undefined>
|
|
13
|
+
>;
|
|
14
|
+
readonly 'character-reference': Readonly<
|
|
15
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
16
|
+
>;
|
|
17
|
+
readonly 'class-naming': Readonly<
|
|
18
|
+
import('@markuplint/ml-core').RuleSeed<import('./class-naming').Value, undefined>
|
|
19
|
+
>;
|
|
20
|
+
readonly 'deprecated-attr': Readonly<
|
|
21
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
22
|
+
>;
|
|
23
|
+
readonly 'deprecated-element': Readonly<
|
|
24
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
25
|
+
>;
|
|
26
|
+
readonly 'disallowed-element': Readonly<import('@markuplint/ml-core').RuleSeed<string[], undefined>>;
|
|
27
|
+
readonly doctype: Readonly<
|
|
28
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
29
|
+
'always',
|
|
30
|
+
{
|
|
31
|
+
denyObsoleteType: boolean;
|
|
32
|
+
}
|
|
33
|
+
>
|
|
34
|
+
>;
|
|
35
|
+
readonly 'end-tag': Readonly<import('@markuplint/ml-core').RuleSeed<boolean, undefined>>;
|
|
36
|
+
readonly 'id-duplication': Readonly<
|
|
37
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
38
|
+
>;
|
|
39
|
+
readonly 'ineffective-attr': Readonly<
|
|
40
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
41
|
+
>;
|
|
42
|
+
readonly 'invalid-attr': Readonly<
|
|
43
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
44
|
+
boolean,
|
|
45
|
+
{
|
|
46
|
+
allowAttrs?:
|
|
47
|
+
| Record<
|
|
48
|
+
string,
|
|
49
|
+
| {
|
|
50
|
+
enum: [string, ...string[]];
|
|
51
|
+
}
|
|
52
|
+
| {
|
|
53
|
+
pattern: string;
|
|
54
|
+
}
|
|
55
|
+
| {
|
|
56
|
+
type: import('packages/@markuplint/ml-spec/lib').AttributeType;
|
|
57
|
+
}
|
|
58
|
+
>
|
|
59
|
+
| (
|
|
60
|
+
| string
|
|
61
|
+
| {
|
|
62
|
+
name: string;
|
|
63
|
+
value:
|
|
64
|
+
| import('packages/@markuplint/ml-spec/lib').AttributeType
|
|
65
|
+
| (
|
|
66
|
+
| {
|
|
67
|
+
enum: [string, ...string[]];
|
|
68
|
+
}
|
|
69
|
+
| {
|
|
70
|
+
pattern: string;
|
|
71
|
+
}
|
|
72
|
+
| {
|
|
73
|
+
type: import('packages/@markuplint/ml-spec/lib').AttributeType;
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
)[]
|
|
78
|
+
| undefined;
|
|
79
|
+
disallowAttrs?:
|
|
80
|
+
| Record<
|
|
81
|
+
string,
|
|
82
|
+
| {
|
|
83
|
+
enum: [string, ...string[]];
|
|
84
|
+
}
|
|
85
|
+
| {
|
|
86
|
+
pattern: string;
|
|
87
|
+
}
|
|
88
|
+
| {
|
|
89
|
+
type: import('packages/@markuplint/ml-spec/lib').AttributeType;
|
|
90
|
+
}
|
|
91
|
+
>
|
|
92
|
+
| (
|
|
93
|
+
| string
|
|
94
|
+
| {
|
|
95
|
+
name: string;
|
|
96
|
+
value:
|
|
97
|
+
| import('packages/@markuplint/ml-spec/lib').AttributeType
|
|
98
|
+
| (
|
|
99
|
+
| {
|
|
100
|
+
enum: [string, ...string[]];
|
|
101
|
+
}
|
|
102
|
+
| {
|
|
103
|
+
pattern: string;
|
|
104
|
+
}
|
|
105
|
+
| {
|
|
106
|
+
type: import('packages/@markuplint/ml-spec/lib').AttributeType;
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
)[]
|
|
111
|
+
| undefined;
|
|
112
|
+
ignoreAttrNamePrefix?: string | string[] | undefined;
|
|
113
|
+
allowToAddPropertiesForPretender?: boolean | undefined;
|
|
114
|
+
attrs?:
|
|
115
|
+
| Record<
|
|
116
|
+
string,
|
|
117
|
+
| (
|
|
118
|
+
| {
|
|
119
|
+
enum: [string, ...string[]];
|
|
120
|
+
}
|
|
121
|
+
| {
|
|
122
|
+
pattern: string;
|
|
123
|
+
}
|
|
124
|
+
| {
|
|
125
|
+
type: import('packages/@markuplint/ml-spec/lib').AttributeType;
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
| {
|
|
129
|
+
disallowed: true;
|
|
130
|
+
}
|
|
131
|
+
>
|
|
132
|
+
| undefined;
|
|
133
|
+
}
|
|
134
|
+
>
|
|
135
|
+
>;
|
|
136
|
+
readonly 'label-has-control': Readonly<
|
|
137
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
138
|
+
>;
|
|
139
|
+
readonly 'landmark-roles': Readonly<
|
|
140
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
141
|
+
boolean,
|
|
142
|
+
{
|
|
143
|
+
ignoreRoles: (
|
|
144
|
+
| ('banner' | 'main' | 'complementary' | 'contentinfo')
|
|
145
|
+
| 'form'
|
|
146
|
+
| 'navigation'
|
|
147
|
+
| 'region'
|
|
148
|
+
)[];
|
|
149
|
+
labelEachArea: boolean;
|
|
150
|
+
}
|
|
151
|
+
>
|
|
152
|
+
>;
|
|
153
|
+
readonly 'no-boolean-attr-value': Readonly<
|
|
154
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
155
|
+
>;
|
|
156
|
+
readonly 'no-default-value': Readonly<
|
|
157
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
158
|
+
>;
|
|
159
|
+
readonly 'no-empty-palpable-content': Readonly<
|
|
160
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
161
|
+
boolean,
|
|
162
|
+
{
|
|
163
|
+
extendsExposableElements?: boolean | undefined;
|
|
164
|
+
ignoreIfAriaBusy?: boolean | undefined;
|
|
165
|
+
}
|
|
166
|
+
>
|
|
167
|
+
>;
|
|
168
|
+
readonly 'no-hard-code-id': Readonly<
|
|
169
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
170
|
+
>;
|
|
171
|
+
readonly 'no-refer-to-non-existent-id': Readonly<
|
|
172
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
173
|
+
import('@markuplint/ml-core').RuleConfigValue,
|
|
174
|
+
{
|
|
175
|
+
ariaVersion: '1.1' | '1.2' | '1.3';
|
|
176
|
+
fragmentRefersNameAttr: boolean;
|
|
177
|
+
}
|
|
178
|
+
>
|
|
179
|
+
>;
|
|
180
|
+
readonly 'no-use-event-handler-attr': Readonly<
|
|
181
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
182
|
+
boolean,
|
|
183
|
+
{
|
|
184
|
+
ignore?: string | string[] | undefined;
|
|
185
|
+
}
|
|
186
|
+
>
|
|
187
|
+
>;
|
|
188
|
+
readonly 'permitted-contents': Readonly<
|
|
189
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
190
|
+
import('./permitted-contents/types').TagRule[],
|
|
191
|
+
import('./permitted-contents/types').Options
|
|
192
|
+
>
|
|
193
|
+
>;
|
|
194
|
+
readonly 'placeholder-label-option': Readonly<import('@markuplint/ml-core').RuleSeed<boolean, undefined>>;
|
|
195
|
+
readonly 'require-accessible-name': Readonly<
|
|
196
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
197
|
+
boolean,
|
|
198
|
+
{
|
|
199
|
+
ariaVersion: '1.1' | '1.2' | '1.3';
|
|
200
|
+
}
|
|
201
|
+
>
|
|
202
|
+
>;
|
|
203
|
+
readonly 'require-datetime': Readonly<
|
|
204
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
205
|
+
boolean,
|
|
206
|
+
{
|
|
207
|
+
langs?: import('./require-datetime/types').Lang[] | undefined;
|
|
208
|
+
}
|
|
209
|
+
>
|
|
210
|
+
>;
|
|
211
|
+
readonly 'required-attr': Readonly<
|
|
212
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
213
|
+
| string
|
|
214
|
+
| (
|
|
215
|
+
| string
|
|
216
|
+
| {
|
|
217
|
+
name: string;
|
|
218
|
+
value?: string | string[] | undefined;
|
|
219
|
+
}
|
|
220
|
+
)[],
|
|
221
|
+
undefined
|
|
222
|
+
>
|
|
223
|
+
>;
|
|
224
|
+
readonly 'required-element': Readonly<
|
|
225
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
226
|
+
string[],
|
|
227
|
+
{
|
|
228
|
+
ignoreHasMutableContents: boolean;
|
|
229
|
+
}
|
|
230
|
+
>
|
|
231
|
+
>;
|
|
232
|
+
readonly 'required-h1': Readonly<import('@markuplint/ml-core').RuleSeed<boolean, import('./required-h1').Options>>;
|
|
233
|
+
readonly 'use-list': Readonly<
|
|
234
|
+
import('@markuplint/ml-core').RuleSeed<
|
|
235
|
+
readonly string[],
|
|
236
|
+
{
|
|
237
|
+
spaceNeededBullets?: string[] | undefined;
|
|
238
|
+
}
|
|
239
|
+
>
|
|
240
|
+
>;
|
|
241
|
+
readonly 'wai-aria': Readonly<import('@markuplint/ml-core').RuleSeed<boolean, import('./wai-aria/types').Options>>;
|
|
101
242
|
};
|
|
102
243
|
export default rules;
|
|
@@ -1,51 +1,100 @@
|
|
|
1
1
|
import type { ChildNode, Element, Hints, MissingNodeReason, RepeatSign, Specs } from './types';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
PermittedContentPattern,
|
|
4
|
+
PermittedContentChoice,
|
|
5
|
+
PermittedContentOneOrMore,
|
|
6
|
+
PermittedContentOptional,
|
|
7
|
+
PermittedContentRequire,
|
|
8
|
+
PermittedContentTransparent,
|
|
9
|
+
PermittedContentZeroOrMore,
|
|
10
|
+
Model,
|
|
11
|
+
} from '@markuplint/ml-spec';
|
|
3
12
|
import type { ReadonlyDeep } from 'type-fest';
|
|
4
13
|
export declare function getChildNodesWithoutWhitespaces(el: Element): ChildNode[];
|
|
5
14
|
export declare function isModel(model: ReadonlyDeep<Model | PermittedContentPattern[]>): model is ReadonlyDeep<Model>;
|
|
6
|
-
export declare function matches(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
export declare function matches(
|
|
16
|
+
selector: string,
|
|
17
|
+
node: ChildNode,
|
|
18
|
+
specs: Specs,
|
|
19
|
+
):
|
|
20
|
+
| {
|
|
21
|
+
matched: boolean;
|
|
22
|
+
not?: undefined;
|
|
23
|
+
}
|
|
24
|
+
| {
|
|
25
|
+
matched: boolean;
|
|
26
|
+
not: ChildNode | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare function isRequire(
|
|
29
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
30
|
+
): content is ReadonlyDeep<PermittedContentRequire>;
|
|
31
|
+
export declare function isOptional(
|
|
32
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
33
|
+
): content is ReadonlyDeep<PermittedContentOptional>;
|
|
34
|
+
export declare function isOneOrMore(
|
|
35
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
36
|
+
): content is ReadonlyDeep<PermittedContentOneOrMore>;
|
|
37
|
+
export declare function isZeroOrMore(
|
|
38
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
39
|
+
): content is ReadonlyDeep<PermittedContentZeroOrMore>;
|
|
40
|
+
export declare function isChoice(
|
|
41
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
42
|
+
): content is ReadonlyDeep<PermittedContentChoice>;
|
|
43
|
+
export declare function isTransparent(
|
|
44
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
45
|
+
): content is ReadonlyDeep<PermittedContentTransparent>;
|
|
46
|
+
export declare function normalizeModel(
|
|
47
|
+
pattern:
|
|
48
|
+
| ReadonlyDeep<PermittedContentRequire>
|
|
49
|
+
| ReadonlyDeep<PermittedContentOptional>
|
|
50
|
+
| ReadonlyDeep<PermittedContentOneOrMore>
|
|
51
|
+
| ReadonlyDeep<PermittedContentZeroOrMore>,
|
|
52
|
+
): {
|
|
53
|
+
model: ReadonlyDeep<PermittedContentPattern[] | Model>;
|
|
54
|
+
min: number;
|
|
55
|
+
max: number;
|
|
56
|
+
repeat: RepeatSign;
|
|
57
|
+
missingType: MissingNodeReason | undefined;
|
|
12
58
|
};
|
|
13
|
-
export declare function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
59
|
+
export declare function mergeHints(
|
|
60
|
+
a: Readonly<Hints>,
|
|
61
|
+
b: Readonly<Hints>,
|
|
62
|
+
): Partial<{
|
|
63
|
+
missing:
|
|
64
|
+
| Partial<{
|
|
65
|
+
barelyMatchedElements?: number | undefined;
|
|
66
|
+
need?: string | undefined;
|
|
67
|
+
}>
|
|
68
|
+
| undefined;
|
|
69
|
+
max?: number | undefined;
|
|
70
|
+
not?:
|
|
71
|
+
| import('packages/@markuplint/ml-core/lib').DocumentType<
|
|
72
|
+
import('./types').TagRule[],
|
|
73
|
+
import('./types').Options
|
|
74
|
+
>
|
|
75
|
+
| import('packages/@markuplint/ml-core/lib/ml-dom/node/character-data').MLCharacterData<
|
|
76
|
+
import('./types').TagRule[],
|
|
77
|
+
import('./types').Options,
|
|
78
|
+
import('packages/@markuplint/ml-ast/lib').MLASTAbstractNode
|
|
79
|
+
>
|
|
80
|
+
| import('packages/@markuplint/ml-core/lib').Element<import('./types').TagRule[], import('./types').Options>
|
|
81
|
+
| import('packages/@markuplint/ml-core/lib').Block<import('./types').TagRule[], import('./types').Options>
|
|
82
|
+
| undefined;
|
|
83
|
+
transparent?: Element | undefined;
|
|
34
84
|
}>;
|
|
35
85
|
export declare function cleanObject<T extends Object>(object: T): Partial<T>;
|
|
36
86
|
export declare class Collection {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
export declare class UnsupportedError extends Error {
|
|
87
|
+
#private;
|
|
88
|
+
constructor(origin: readonly ChildNode[]);
|
|
89
|
+
get matched(): ChildNode[];
|
|
90
|
+
get matchedCount(): number;
|
|
91
|
+
get nodes(): ChildNode[];
|
|
92
|
+
get unmatched(): ChildNode[];
|
|
93
|
+
addMatched(nodes: ChildNode[]): boolean;
|
|
94
|
+
back(): void;
|
|
95
|
+
lock(): void;
|
|
96
|
+
max(max: number): void;
|
|
97
|
+
toString(highlightExtraNodes?: boolean): string;
|
|
50
98
|
}
|
|
99
|
+
export declare class UnsupportedError extends Error {}
|
|
51
100
|
export declare function modelLog(model: ReadonlyDeep<Model | PermittedContentPattern[]>, repeat: RepeatSign): string;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { ElementChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty, ARIARole } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingRequiredProp: ElementChecker<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export declare const checkingRequiredProp: ElementChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
role?:
|
|
9
|
+
| (ARIARole & {
|
|
10
|
+
isImplicit?: boolean;
|
|
11
|
+
})
|
|
12
|
+
| null;
|
|
13
|
+
propSpecs: readonly ARIAProperty[];
|
|
14
|
+
}
|
|
15
|
+
>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { AttrChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty, ARIARole } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingDisallowedProp: AttrChecker<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export declare const checkingDisallowedProp: AttrChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
role: ARIARole | null;
|
|
9
|
+
propSpecs: readonly ARIAProperty[];
|
|
10
|
+
}
|
|
11
|
+
>;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { ElementChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty, ARIARole } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingRequiredProp: ElementChecker<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export declare const checkingRequiredProp: ElementChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
role?:
|
|
9
|
+
| (ARIARole & {
|
|
10
|
+
isImplicit?: boolean;
|
|
11
|
+
})
|
|
12
|
+
| null;
|
|
13
|
+
propSpecs: readonly ARIAProperty[];
|
|
14
|
+
}
|
|
15
|
+
>;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { ElementChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty, ARIARole } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingUnadoptedExplicitRoles: ElementChecker<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export declare const checkingUnadoptedExplicitRoles: ElementChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
role?:
|
|
9
|
+
| (ARIARole & {
|
|
10
|
+
isImplicit?: boolean;
|
|
11
|
+
})
|
|
12
|
+
| null;
|
|
13
|
+
propSpecs: readonly ARIAProperty[];
|
|
14
|
+
}
|
|
15
|
+
>;
|
package/lib/xxx/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ml_core_1 = require("@markuplint/ml-core");
|
|
4
|
+
exports.default = (0, ml_core_1.createRule)({
|
|
5
|
+
defaultValue: true,
|
|
6
|
+
defaultOptions: null,
|
|
7
|
+
async verify({ document, report, t }) {
|
|
8
|
+
// Element
|
|
9
|
+
await document.walkOn("Element", (el) => {
|
|
10
|
+
const raw = el.raw.trim();
|
|
11
|
+
if (/./i.test(raw)) {
|
|
12
|
+
report({
|
|
13
|
+
scope: el,
|
|
14
|
+
message: t("It is {0}", "issue"),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
// Attribute
|
|
19
|
+
await document.walkOn("Attr", (attr) => {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
if (/./i.test(attr.name)) {
|
|
22
|
+
report({
|
|
23
|
+
scope: attr,
|
|
24
|
+
line: (_a = attr.nameNode) === null || _a === void 0 ? void 0 : _a.startLine,
|
|
25
|
+
col: (_b = attr.nameNode) === null || _b === void 0 ? void 0 : _b.startCol,
|
|
26
|
+
raw: (_c = attr.nameNode) === null || _c === void 0 ? void 0 : _c.raw,
|
|
27
|
+
message: t("It is {0}", "issue"),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
});
|