@marko/language-server 1.0.20 → 1.1.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/index.js +887 -126
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +835 -72
- package/dist/index.mjs.map +4 -4
- package/dist/service/html/axe-rules/axe-rules.d.ts +511 -0
- package/dist/service/html/axe-rules/generate-axe-rules.d.ts +1 -0
- package/dist/service/html/axe-rules/separated-rules.d.ts +48 -0
- package/dist/service/html/index.d.ts +3 -0
- package/dist/service/index.d.ts +8 -0
- package/dist/utils/text-documents.d.ts +5 -2
- package/package.json +9 -7
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
export declare const keyboard: {
|
|
2
|
+
/**
|
|
3
|
+
* - Ensures every accesskey attribute value is unique
|
|
4
|
+
* - accesskey attribute value should be unique ([url](https://dequeuniversity.com/rules/axe/4.4/accesskeys?application=axeAPI))
|
|
5
|
+
*/
|
|
6
|
+
accesskeys: string;
|
|
7
|
+
/**
|
|
8
|
+
* - Ensures each page has at least one mechanism for a user to bypass navigation and jump straight to the content
|
|
9
|
+
* - Page must have means to bypass repeated blocks ([url](https://dequeuniversity.com/rules/axe/4.4/bypass?application=axeAPI))
|
|
10
|
+
*/
|
|
11
|
+
bypass: string;
|
|
12
|
+
/**
|
|
13
|
+
* - Ensures elements in the focus order have a role appropriate for interactive content
|
|
14
|
+
* - Elements in the focus order should have an appropriate role ([url](https://dequeuniversity.com/rules/axe/4.4/focus-order-semantics?application=axeAPI))
|
|
15
|
+
*/
|
|
16
|
+
focusOrderSemantics: string;
|
|
17
|
+
/**
|
|
18
|
+
* - Ensures `<frame>` and `<iframe>` elements with focusable content do not have tabindex=-1
|
|
19
|
+
* - Frames with focusable content must not have tabindex=-1 ([url](https://dequeuniversity.com/rules/axe/4.4/frame-focusable-content?application=axeAPI))
|
|
20
|
+
*/
|
|
21
|
+
frameFocusableContent: string;
|
|
22
|
+
/**
|
|
23
|
+
* - Ensures interactive controls are not nested as they are not always announced by screen readers or can cause focus problems for assistive technologies
|
|
24
|
+
* - Interactive controls must not be nested ([url](https://dequeuniversity.com/rules/axe/4.4/nested-interactive?application=axeAPI))
|
|
25
|
+
*/
|
|
26
|
+
nestedInteractive: string;
|
|
27
|
+
/**
|
|
28
|
+
* - Ensures all page content is contained by landmarks
|
|
29
|
+
* - All page content should be contained by landmarks ([url](https://dequeuniversity.com/rules/axe/4.4/region?application=axeAPI))
|
|
30
|
+
*/
|
|
31
|
+
region: string;
|
|
32
|
+
/**
|
|
33
|
+
* - Ensure elements that have scrollable content are accessible by keyboard
|
|
34
|
+
* - Scrollable region must have keyboard access ([url](https://dequeuniversity.com/rules/axe/4.4/scrollable-region-focusable?application=axeAPI))
|
|
35
|
+
*/
|
|
36
|
+
scrollableRegionFocusable: string;
|
|
37
|
+
/**
|
|
38
|
+
* - Ensure all skip links have a focusable target
|
|
39
|
+
* - The skip-link target should exist and be focusable ([url](https://dequeuniversity.com/rules/axe/4.4/skip-link?application=axeAPI))
|
|
40
|
+
*/
|
|
41
|
+
skipLink: string;
|
|
42
|
+
/**
|
|
43
|
+
* - Ensures tabindex attribute values are not greater than 0
|
|
44
|
+
* - Elements should not have tabindex greater than zero ([url](https://dequeuniversity.com/rules/axe/4.4/tabindex?application=axeAPI))
|
|
45
|
+
*/
|
|
46
|
+
tabindex: string;
|
|
47
|
+
};
|
|
48
|
+
export declare const textAlternatives: {
|
|
49
|
+
/**
|
|
50
|
+
* - Ensures `<area>` elements of image maps have alternate text
|
|
51
|
+
* - Active `<area>` elements must have alternate text ([url](https://dequeuniversity.com/rules/axe/4.4/area-alt?application=axeAPI))
|
|
52
|
+
*/
|
|
53
|
+
areaAlt: string;
|
|
54
|
+
/**
|
|
55
|
+
* - Ensures each HTML document contains a non-empty `<title>` element
|
|
56
|
+
* - Documents must have `<title>` element to aid in navigation ([url](https://dequeuniversity.com/rules/axe/4.4/document-title?application=axeAPI))
|
|
57
|
+
*/
|
|
58
|
+
documentTitle: string;
|
|
59
|
+
/**
|
|
60
|
+
* - Ensures `<iframe>` and `<frame>` elements contain a unique title attribute
|
|
61
|
+
* - Frames should have a unique title attribute ([url](https://dequeuniversity.com/rules/axe/4.4/frame-title-unique?application=axeAPI))
|
|
62
|
+
*/
|
|
63
|
+
frameTitleUnique: string;
|
|
64
|
+
/**
|
|
65
|
+
* - Ensures `<iframe>` and `<frame>` elements have an accessible name
|
|
66
|
+
* - Frames must have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/frame-title?application=axeAPI))
|
|
67
|
+
*/
|
|
68
|
+
frameTitle: string;
|
|
69
|
+
/**
|
|
70
|
+
* - Ensures `<img>` elements have alternate text or a role of none or presentation
|
|
71
|
+
* - Images must have alternate text ([url](https://dequeuniversity.com/rules/axe/4.4/image-alt?application=axeAPI))
|
|
72
|
+
*/
|
|
73
|
+
imageAlt: string;
|
|
74
|
+
/**
|
|
75
|
+
* - Ensure image alternative is not repeated as text
|
|
76
|
+
* - Alternative text of images should not be repeated as text ([url](https://dequeuniversity.com/rules/axe/4.4/image-redundant-alt?application=axeAPI))
|
|
77
|
+
*/
|
|
78
|
+
imageRedundantAlt: string;
|
|
79
|
+
/**
|
|
80
|
+
* - Ensures `<input type="image">` elements have alternate text
|
|
81
|
+
* - Image buttons must have alternate text ([url](https://dequeuniversity.com/rules/axe/4.4/input-image-alt?application=axeAPI))
|
|
82
|
+
*/
|
|
83
|
+
inputImageAlt: string;
|
|
84
|
+
/**
|
|
85
|
+
* - Ensures `<object>` elements have alternate text
|
|
86
|
+
* - `<object>` elements must have alternate text ([url](https://dequeuniversity.com/rules/axe/4.4/object-alt?application=axeAPI))
|
|
87
|
+
*/
|
|
88
|
+
objectAlt: string;
|
|
89
|
+
/**
|
|
90
|
+
* - Ensures [role='img'] elements have alternate text
|
|
91
|
+
* - [role='img'] elements must have an alternative text ([url](https://dequeuniversity.com/rules/axe/4.4/role-img-alt?application=axeAPI))
|
|
92
|
+
*/
|
|
93
|
+
roleImgAlt: string;
|
|
94
|
+
/**
|
|
95
|
+
* - Ensures that server-side image maps are not used
|
|
96
|
+
* - Server-side image maps must not be used ([url](https://dequeuniversity.com/rules/axe/4.4/server-side-image-map?application=axeAPI))
|
|
97
|
+
*/
|
|
98
|
+
serverSideImageMap: string;
|
|
99
|
+
/**
|
|
100
|
+
* - Ensures `<svg>` elements with an img, graphics-document or graphics-symbol role have an accessible text
|
|
101
|
+
* - `<svg>` elements with an img role must have an alternative text ([url](https://dequeuniversity.com/rules/axe/4.4/svg-img-alt?application=axeAPI))
|
|
102
|
+
*/
|
|
103
|
+
svgImgAlt: string;
|
|
104
|
+
/**
|
|
105
|
+
* - Ensures `<video>` elements have captions
|
|
106
|
+
* - `<video>` elements must have captions ([url](https://dequeuniversity.com/rules/axe/4.4/video-caption?application=axeAPI))
|
|
107
|
+
*/
|
|
108
|
+
videoCaption: string;
|
|
109
|
+
};
|
|
110
|
+
export declare const aria: {
|
|
111
|
+
/**
|
|
112
|
+
* - Ensures ARIA attributes are allowed for an element's role
|
|
113
|
+
* - Elements must only use allowed ARIA attributes ([url](https://dequeuniversity.com/rules/axe/4.4/aria-allowed-attr?application=axeAPI))
|
|
114
|
+
*/
|
|
115
|
+
ariaAllowedAttr: string;
|
|
116
|
+
/**
|
|
117
|
+
* - Ensures role attribute has an appropriate value for the element
|
|
118
|
+
* - ARIA role should be appropriate for the element ([url](https://dequeuniversity.com/rules/axe/4.4/aria-allowed-role?application=axeAPI))
|
|
119
|
+
*/
|
|
120
|
+
ariaAllowedRole: string;
|
|
121
|
+
/**
|
|
122
|
+
* - Ensures every ARIA button, link and menuitem has an accessible name
|
|
123
|
+
* - ARIA commands must have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/aria-command-name?application=axeAPI))
|
|
124
|
+
*/
|
|
125
|
+
ariaCommandName: string;
|
|
126
|
+
/**
|
|
127
|
+
* - Ensures every ARIA dialog and alertdialog node has an accessible name
|
|
128
|
+
* - ARIA dialog and alertdialog nodes should have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/aria-dialog-name?application=axeAPI))
|
|
129
|
+
*/
|
|
130
|
+
ariaDialogName: string;
|
|
131
|
+
/**
|
|
132
|
+
* - Ensures aria-hidden='true' is not present on the document body.
|
|
133
|
+
* - aria-hidden='true' must not be present on the document body ([url](https://dequeuniversity.com/rules/axe/4.4/aria-hidden-body?application=axeAPI))
|
|
134
|
+
*/
|
|
135
|
+
ariaHiddenBody: string;
|
|
136
|
+
/**
|
|
137
|
+
* - Ensures every ARIA input field has an accessible name
|
|
138
|
+
* - ARIA input fields must have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/aria-input-field-name?application=axeAPI))
|
|
139
|
+
*/
|
|
140
|
+
ariaInputFieldName: string;
|
|
141
|
+
/**
|
|
142
|
+
* - Ensures every ARIA meter node has an accessible name
|
|
143
|
+
* - ARIA meter nodes must have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/aria-meter-name?application=axeAPI))
|
|
144
|
+
*/
|
|
145
|
+
ariaMeterName: string;
|
|
146
|
+
/**
|
|
147
|
+
* - Ensures every ARIA progressbar node has an accessible name
|
|
148
|
+
* - ARIA progressbar nodes must have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/aria-progressbar-name?application=axeAPI))
|
|
149
|
+
*/
|
|
150
|
+
ariaProgressbarName: string;
|
|
151
|
+
/**
|
|
152
|
+
* - Ensures elements with ARIA roles have all required ARIA attributes
|
|
153
|
+
* - Required ARIA attributes must be provided ([url](https://dequeuniversity.com/rules/axe/4.4/aria-required-attr?application=axeAPI))
|
|
154
|
+
*/
|
|
155
|
+
ariaRequiredAttr: string;
|
|
156
|
+
/**
|
|
157
|
+
* - Ensures elements with an ARIA role that require child roles contain them
|
|
158
|
+
* - Certain ARIA roles must contain particular children ([url](https://dequeuniversity.com/rules/axe/4.4/aria-required-children?application=axeAPI))
|
|
159
|
+
*/
|
|
160
|
+
ariaRequiredChildren: string;
|
|
161
|
+
/**
|
|
162
|
+
* - Ensures elements with an ARIA role that require parent roles are contained by them
|
|
163
|
+
* - Certain ARIA roles must be contained by particular parents ([url](https://dequeuniversity.com/rules/axe/4.4/aria-required-parent?application=axeAPI))
|
|
164
|
+
*/
|
|
165
|
+
ariaRequiredParent: string;
|
|
166
|
+
/**
|
|
167
|
+
* - Ensure aria-roledescription is only used on elements with an implicit or explicit role
|
|
168
|
+
* - aria-roledescription must be on elements with a semantic role ([url](https://dequeuniversity.com/rules/axe/4.4/aria-roledescription?application=axeAPI))
|
|
169
|
+
*/
|
|
170
|
+
ariaRoledescription: string;
|
|
171
|
+
/**
|
|
172
|
+
* - Ensures all elements with a role attribute use a valid value
|
|
173
|
+
* - ARIA roles used must conform to valid values ([url](https://dequeuniversity.com/rules/axe/4.4/aria-roles?application=axeAPI))
|
|
174
|
+
*/
|
|
175
|
+
ariaRoles: string;
|
|
176
|
+
/**
|
|
177
|
+
* - Ensures "role=text" is used on elements with no focusable descendants
|
|
178
|
+
* - "role=text" should have no focusable descendants ([url](https://dequeuniversity.com/rules/axe/4.4/aria-text?application=axeAPI))
|
|
179
|
+
*/
|
|
180
|
+
ariaText: string;
|
|
181
|
+
/**
|
|
182
|
+
* - Ensures every ARIA toggle field has an accessible name
|
|
183
|
+
* - ARIA toggle fields must have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/aria-toggle-field-name?application=axeAPI))
|
|
184
|
+
*/
|
|
185
|
+
ariaToggleFieldName: string;
|
|
186
|
+
/**
|
|
187
|
+
* - Ensures every ARIA tooltip node has an accessible name
|
|
188
|
+
* - ARIA tooltip nodes must have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/aria-tooltip-name?application=axeAPI))
|
|
189
|
+
*/
|
|
190
|
+
ariaTooltipName: string;
|
|
191
|
+
/**
|
|
192
|
+
* - Ensures every ARIA treeitem node has an accessible name
|
|
193
|
+
* - ARIA treeitem nodes should have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/aria-treeitem-name?application=axeAPI))
|
|
194
|
+
*/
|
|
195
|
+
ariaTreeitemName: string;
|
|
196
|
+
/**
|
|
197
|
+
* - Ensures all ARIA attributes have valid values
|
|
198
|
+
* - ARIA attributes must conform to valid values ([url](https://dequeuniversity.com/rules/axe/4.4/aria-valid-attr-value?application=axeAPI))
|
|
199
|
+
*/
|
|
200
|
+
ariaValidAttrValue: string;
|
|
201
|
+
/**
|
|
202
|
+
* - Ensures attributes that begin with aria- are valid ARIA attributes
|
|
203
|
+
* - ARIA attributes must conform to valid names ([url](https://dequeuniversity.com/rules/axe/4.4/aria-valid-attr?application=axeAPI))
|
|
204
|
+
*/
|
|
205
|
+
ariaValidAttr: string;
|
|
206
|
+
/**
|
|
207
|
+
* - Ensures table headers have discernible text
|
|
208
|
+
* - Table header text must not be empty ([url](https://dequeuniversity.com/rules/axe/4.4/empty-table-header?application=axeAPI))
|
|
209
|
+
*/
|
|
210
|
+
emptyTableHeader: string;
|
|
211
|
+
/**
|
|
212
|
+
* - Flags elements whose role is none or presentation and which cause the role conflict resolution to trigger.
|
|
213
|
+
* - Elements of role none or presentation should be flagged ([url](https://dequeuniversity.com/rules/axe/4.4/presentation-role-conflict?application=axeAPI))
|
|
214
|
+
*/
|
|
215
|
+
presentationRoleConflict: string;
|
|
216
|
+
};
|
|
217
|
+
export declare const nameRoleValue: {
|
|
218
|
+
/**
|
|
219
|
+
* - Ensures aria-hidden elements are not focusable nor contain focusable elements
|
|
220
|
+
* - ARIA hidden element must not be focusable or contain focusable elements ([url](https://dequeuniversity.com/rules/axe/4.4/aria-hidden-focus?application=axeAPI))
|
|
221
|
+
*/
|
|
222
|
+
ariaHiddenFocus: string;
|
|
223
|
+
/**
|
|
224
|
+
* - Ensures buttons have discernible text
|
|
225
|
+
* - Buttons must have discernible text ([url](https://dequeuniversity.com/rules/axe/4.4/button-name?application=axeAPI))
|
|
226
|
+
*/
|
|
227
|
+
buttonName: string;
|
|
228
|
+
/**
|
|
229
|
+
* - Ensures headings have discernible text
|
|
230
|
+
* - Headings should not be empty ([url](https://dequeuniversity.com/rules/axe/4.4/empty-heading?application=axeAPI))
|
|
231
|
+
*/
|
|
232
|
+
emptyHeading: string;
|
|
233
|
+
/**
|
|
234
|
+
* - Ensures input buttons have discernible text
|
|
235
|
+
* - Input buttons must have discernible text ([url](https://dequeuniversity.com/rules/axe/4.4/input-button-name?application=axeAPI))
|
|
236
|
+
*/
|
|
237
|
+
inputButtonName: string;
|
|
238
|
+
/**
|
|
239
|
+
* - Ensures links have discernible text
|
|
240
|
+
* - Links must have discernible text ([url](https://dequeuniversity.com/rules/axe/4.4/link-name?application=axeAPI))
|
|
241
|
+
*/
|
|
242
|
+
linkName: string;
|
|
243
|
+
};
|
|
244
|
+
export declare const timeAndMedia: {
|
|
245
|
+
/**
|
|
246
|
+
* - Ensures `<audio>` elements have captions
|
|
247
|
+
* - `<audio>` elements must have a captions track ([url](https://dequeuniversity.com/rules/axe/4.4/audio-caption?application=axeAPI))
|
|
248
|
+
*/
|
|
249
|
+
audioCaption: string;
|
|
250
|
+
/**
|
|
251
|
+
* - Ensures `<blink>` elements are not used
|
|
252
|
+
* - `<blink>` elements are deprecated and must not be used ([url](https://dequeuniversity.com/rules/axe/4.4/blink?application=axeAPI))
|
|
253
|
+
*/
|
|
254
|
+
blink: string;
|
|
255
|
+
/**
|
|
256
|
+
* - Ensures `<meta http-equiv="refresh">` is not used
|
|
257
|
+
* - Timed refresh must not exist ([url](https://dequeuniversity.com/rules/axe/4.4/meta-refresh?application=axeAPI))
|
|
258
|
+
*/
|
|
259
|
+
metaRefresh: string;
|
|
260
|
+
/**
|
|
261
|
+
* - Ensures `<video>` or `<audio>` elements do not autoplay audio for more than 3 seconds without a control mechanism to stop or mute the audio
|
|
262
|
+
* - `<video>` or `<audio>` elements must not play automatically ([url](https://dequeuniversity.com/rules/axe/4.4/no-autoplay-audio?application=axeAPI))
|
|
263
|
+
*/
|
|
264
|
+
noAutoplayAudio: string;
|
|
265
|
+
};
|
|
266
|
+
export declare const forms: {
|
|
267
|
+
/**
|
|
268
|
+
* - Ensure the autocomplete attribute is correct and suitable for the form field
|
|
269
|
+
* - autocomplete attribute must be used correctly ([url](https://dequeuniversity.com/rules/axe/4.4/autocomplete-valid?application=axeAPI))
|
|
270
|
+
*/
|
|
271
|
+
autocompleteValid: string;
|
|
272
|
+
/**
|
|
273
|
+
* - Ensures form field does not have multiple label elements
|
|
274
|
+
* - Form field must not have multiple label elements ([url](https://dequeuniversity.com/rules/axe/4.4/form-field-multiple-labels?application=axeAPI))
|
|
275
|
+
*/
|
|
276
|
+
formFieldMultipleLabels: string;
|
|
277
|
+
/**
|
|
278
|
+
* - Ensures that every form element has a visible label and is not solely labeled using hidden labels, or the title or aria-describedby attributes
|
|
279
|
+
* - Form elements should have a visible label ([url](https://dequeuniversity.com/rules/axe/4.4/label-title-only?application=axeAPI))
|
|
280
|
+
*/
|
|
281
|
+
labelTitleOnly: string;
|
|
282
|
+
/**
|
|
283
|
+
* - Ensures every form element has a label
|
|
284
|
+
* - Form elements must have labels ([url](https://dequeuniversity.com/rules/axe/4.4/label?application=axeAPI))
|
|
285
|
+
*/
|
|
286
|
+
label: string;
|
|
287
|
+
/**
|
|
288
|
+
* - Ensures select element has an accessible name
|
|
289
|
+
* - Select element must have an accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/select-name?application=axeAPI))
|
|
290
|
+
*/
|
|
291
|
+
selectName: string;
|
|
292
|
+
};
|
|
293
|
+
export declare const structure: {
|
|
294
|
+
/**
|
|
295
|
+
* - Ensure that text spacing set through style attributes can be adjusted with custom stylesheets
|
|
296
|
+
* - Inline text spacing must be adjustable with custom stylesheets ([url](https://dequeuniversity.com/rules/axe/4.4/avoid-inline-spacing?application=axeAPI))
|
|
297
|
+
*/
|
|
298
|
+
avoidInlineSpacing: string;
|
|
299
|
+
/**
|
|
300
|
+
* - Ensures content is not locked to any specific display orientation, and the content is operable in all display orientations
|
|
301
|
+
* - CSS Media queries must not lock display orientation ([url](https://dequeuniversity.com/rules/axe/4.4/css-orientation-lock?application=axeAPI))
|
|
302
|
+
*/
|
|
303
|
+
cssOrientationLock: string;
|
|
304
|
+
/**
|
|
305
|
+
* - Ensures `<dl>` elements are structured correctly
|
|
306
|
+
* - `<dl>` elements must only directly contain properly-ordered `<dt>` and `<dd>` groups, `<script>`, `<template>` or `<div>` elements ([url](https://dequeuniversity.com/rules/axe/4.4/definition-list?application=axeAPI))
|
|
307
|
+
*/
|
|
308
|
+
definitionList: string;
|
|
309
|
+
/**
|
|
310
|
+
* - Ensures `<dt>` and `<dd>` elements are contained by a `<dl>`
|
|
311
|
+
* - `<dt>` and `<dd>` elements must be contained by a `<dl>` ([url](https://dequeuniversity.com/rules/axe/4.4/dlitem?application=axeAPI))
|
|
312
|
+
*/
|
|
313
|
+
dlitem: string;
|
|
314
|
+
/**
|
|
315
|
+
* - Ensures `<iframe>` and `<frame>` elements contain the axe-core script
|
|
316
|
+
* - Frames should be tested with axe-core ([url](https://dequeuniversity.com/rules/axe/4.4/frame-tested?application=axeAPI))
|
|
317
|
+
*/
|
|
318
|
+
frameTested: string;
|
|
319
|
+
/**
|
|
320
|
+
* - Informs users about hidden content.
|
|
321
|
+
* - Hidden content on the page should be analyzed ([url](https://dequeuniversity.com/rules/axe/4.4/hidden-content?application=axeAPI))
|
|
322
|
+
*/
|
|
323
|
+
hiddenContent: string;
|
|
324
|
+
/**
|
|
325
|
+
* - Ensures that lists are structured correctly
|
|
326
|
+
* - `<ul>` and `<ol>` must only directly contain `<li>`, `<script>` or `<template>` elements ([url](https://dequeuniversity.com/rules/axe/4.4/list?application=axeAPI))
|
|
327
|
+
*/
|
|
328
|
+
list: string;
|
|
329
|
+
/**
|
|
330
|
+
* - Ensures `<li>` elements are used semantically
|
|
331
|
+
* - `<li>` elements must be contained in a `<ul>` or `<ol>` ([url](https://dequeuniversity.com/rules/axe/4.4/listitem?application=axeAPI))
|
|
332
|
+
*/
|
|
333
|
+
listitem: string;
|
|
334
|
+
};
|
|
335
|
+
export declare const color: {
|
|
336
|
+
/**
|
|
337
|
+
* - Ensures the contrast between foreground and background colors meets WCAG 2 AAA contrast ratio thresholds
|
|
338
|
+
* - Elements must have sufficient color contrast ([url](https://dequeuniversity.com/rules/axe/4.4/color-contrast-enhanced?application=axeAPI))
|
|
339
|
+
*/
|
|
340
|
+
colorContrastEnhanced: string;
|
|
341
|
+
/**
|
|
342
|
+
* - Ensures the contrast between foreground and background colors meets WCAG 2 AA contrast ratio thresholds
|
|
343
|
+
* - Elements must have sufficient color contrast ([url](https://dequeuniversity.com/rules/axe/4.4/color-contrast?application=axeAPI))
|
|
344
|
+
*/
|
|
345
|
+
colorContrast: string;
|
|
346
|
+
/**
|
|
347
|
+
* - Ensure links are distinguished from surrounding text in a way that does not rely on color
|
|
348
|
+
* - Links must be distinguishable without relying on color ([url](https://dequeuniversity.com/rules/axe/4.4/link-in-text-block?application=axeAPI))
|
|
349
|
+
*/
|
|
350
|
+
linkInTextBlock: string;
|
|
351
|
+
};
|
|
352
|
+
export declare const parsing: {
|
|
353
|
+
/**
|
|
354
|
+
* - Ensures every id attribute value of active elements is unique
|
|
355
|
+
* - IDs of active elements must be unique ([url](https://dequeuniversity.com/rules/axe/4.4/duplicate-id-active?application=axeAPI))
|
|
356
|
+
*/
|
|
357
|
+
duplicateIdActive: string;
|
|
358
|
+
/**
|
|
359
|
+
* - Ensures every id attribute value used in ARIA and in labels is unique
|
|
360
|
+
* - IDs used in ARIA and labels must be unique ([url](https://dequeuniversity.com/rules/axe/4.4/duplicate-id-aria?application=axeAPI))
|
|
361
|
+
*/
|
|
362
|
+
duplicateIdAria: string;
|
|
363
|
+
/**
|
|
364
|
+
* - Ensures every id attribute value is unique
|
|
365
|
+
* - id attribute value must be unique ([url](https://dequeuniversity.com/rules/axe/4.4/duplicate-id?application=axeAPI))
|
|
366
|
+
*/
|
|
367
|
+
duplicateId: string;
|
|
368
|
+
/**
|
|
369
|
+
* - Ensures `<marquee>` elements are not used
|
|
370
|
+
* - `<marquee>` elements are deprecated and must not be used ([url](https://dequeuniversity.com/rules/axe/4.4/marquee?application=axeAPI))
|
|
371
|
+
*/
|
|
372
|
+
marquee: string;
|
|
373
|
+
};
|
|
374
|
+
export declare const semantics: {
|
|
375
|
+
/**
|
|
376
|
+
* - Ensures the order of headings is semantically correct
|
|
377
|
+
* - Heading levels should only increase by one ([url](https://dequeuniversity.com/rules/axe/4.4/heading-order?application=axeAPI))
|
|
378
|
+
*/
|
|
379
|
+
headingOrder: string;
|
|
380
|
+
/**
|
|
381
|
+
* - Ensure that links with the same accessible name serve a similar purpose
|
|
382
|
+
* - Links with the same name must have a similar purpose ([url](https://dequeuniversity.com/rules/axe/4.4/identical-links-same-purpose?application=axeAPI))
|
|
383
|
+
*/
|
|
384
|
+
identicalLinksSamePurpose: string;
|
|
385
|
+
/**
|
|
386
|
+
* - Ensures that elements labelled through their content must have their visible text as part of their accessible name
|
|
387
|
+
* - Elements must have their visible text as part of their accessible name ([url](https://dequeuniversity.com/rules/axe/4.4/label-content-name-mismatch?application=axeAPI))
|
|
388
|
+
*/
|
|
389
|
+
labelContentNameMismatch: string;
|
|
390
|
+
/**
|
|
391
|
+
* - Ensures the banner landmark is at top level
|
|
392
|
+
* - Banner landmark should not be contained in another landmark ([url](https://dequeuniversity.com/rules/axe/4.4/landmark-banner-is-top-level?application=axeAPI))
|
|
393
|
+
*/
|
|
394
|
+
landmarkBannerIsTopLevel: string;
|
|
395
|
+
/**
|
|
396
|
+
* - Ensures the complementary landmark or aside is at top level
|
|
397
|
+
* - Aside should not be contained in another landmark ([url](https://dequeuniversity.com/rules/axe/4.4/landmark-complementary-is-top-level?application=axeAPI))
|
|
398
|
+
*/
|
|
399
|
+
landmarkComplementaryIsTopLevel: string;
|
|
400
|
+
/**
|
|
401
|
+
* - Ensures the contentinfo landmark is at top level
|
|
402
|
+
* - Contentinfo landmark should not be contained in another landmark ([url](https://dequeuniversity.com/rules/axe/4.4/landmark-contentinfo-is-top-level?application=axeAPI))
|
|
403
|
+
*/
|
|
404
|
+
landmarkContentinfoIsTopLevel: string;
|
|
405
|
+
/**
|
|
406
|
+
* - Ensures the main landmark is at top level
|
|
407
|
+
* - Main landmark should not be contained in another landmark ([url](https://dequeuniversity.com/rules/axe/4.4/landmark-main-is-top-level?application=axeAPI))
|
|
408
|
+
*/
|
|
409
|
+
landmarkMainIsTopLevel: string;
|
|
410
|
+
/**
|
|
411
|
+
* - Ensures the document has at most one banner landmark
|
|
412
|
+
* - Document should not have more than one banner landmark ([url](https://dequeuniversity.com/rules/axe/4.4/landmark-no-duplicate-banner?application=axeAPI))
|
|
413
|
+
*/
|
|
414
|
+
landmarkNoDuplicateBanner: string;
|
|
415
|
+
/**
|
|
416
|
+
* - Ensures the document has at most one contentinfo landmark
|
|
417
|
+
* - Document should not have more than one contentinfo landmark ([url](https://dequeuniversity.com/rules/axe/4.4/landmark-no-duplicate-contentinfo?application=axeAPI))
|
|
418
|
+
*/
|
|
419
|
+
landmarkNoDuplicateContentinfo: string;
|
|
420
|
+
/**
|
|
421
|
+
* - Ensures the document has at most one main landmark
|
|
422
|
+
* - Document should not have more than one main landmark ([url](https://dequeuniversity.com/rules/axe/4.4/landmark-no-duplicate-main?application=axeAPI))
|
|
423
|
+
*/
|
|
424
|
+
landmarkNoDuplicateMain: string;
|
|
425
|
+
/**
|
|
426
|
+
* - Ensures the document has a main landmark
|
|
427
|
+
* - Document should have one main landmark ([url](https://dequeuniversity.com/rules/axe/4.4/landmark-one-main?application=axeAPI))
|
|
428
|
+
*/
|
|
429
|
+
landmarkOneMain: string;
|
|
430
|
+
/**
|
|
431
|
+
* - Landmarks should have a unique role or role/label/title (i.e. accessible name) combination
|
|
432
|
+
* - Ensures landmarks are unique ([url](https://dequeuniversity.com/rules/axe/4.4/landmark-unique?application=axeAPI))
|
|
433
|
+
*/
|
|
434
|
+
landmarkUnique: string;
|
|
435
|
+
/**
|
|
436
|
+
* - Ensure bold, italic text and font-size is not used to style `<p>` elements as a heading
|
|
437
|
+
* - Styled `<p>` elements must not be used as headings ([url](https://dequeuniversity.com/rules/axe/4.4/p-as-heading?application=axeAPI))
|
|
438
|
+
*/
|
|
439
|
+
pAsHeading: string;
|
|
440
|
+
/**
|
|
441
|
+
* - Ensure that the page, or at least one of its frames contains a level-one heading
|
|
442
|
+
* - Page should contain a level-one heading ([url](https://dequeuniversity.com/rules/axe/4.4/page-has-heading-one?application=axeAPI))
|
|
443
|
+
*/
|
|
444
|
+
pageHasHeadingOne: string;
|
|
445
|
+
};
|
|
446
|
+
export declare const language: {
|
|
447
|
+
/**
|
|
448
|
+
* - Ensures every HTML document has a lang attribute
|
|
449
|
+
* - `<html>` element must have a lang attribute ([url](https://dequeuniversity.com/rules/axe/4.4/html-has-lang?application=axeAPI))
|
|
450
|
+
*/
|
|
451
|
+
htmlHasLang: string;
|
|
452
|
+
/**
|
|
453
|
+
* - Ensures the lang attribute of the `<html>` element has a valid value
|
|
454
|
+
* - `<html>` element must have a valid value for the lang attribute ([url](https://dequeuniversity.com/rules/axe/4.4/html-lang-valid?application=axeAPI))
|
|
455
|
+
*/
|
|
456
|
+
htmlLangValid: string;
|
|
457
|
+
/**
|
|
458
|
+
* - Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page
|
|
459
|
+
* - HTML elements with lang and xml:lang must have the same base language ([url](https://dequeuniversity.com/rules/axe/4.4/html-xml-lang-mismatch?application=axeAPI))
|
|
460
|
+
*/
|
|
461
|
+
htmlXmlLangMismatch: string;
|
|
462
|
+
/**
|
|
463
|
+
* - Ensures lang attributes have valid values
|
|
464
|
+
* - lang attribute must have a valid value ([url](https://dequeuniversity.com/rules/axe/4.4/valid-lang?application=axeAPI))
|
|
465
|
+
*/
|
|
466
|
+
validLang: string;
|
|
467
|
+
};
|
|
468
|
+
export declare const sensoryAndVisualCues: {
|
|
469
|
+
/**
|
|
470
|
+
* - Ensures `<meta name="viewport">` can scale a significant amount
|
|
471
|
+
* - Users should be able to zoom and scale the text up to 500% ([url](https://dequeuniversity.com/rules/axe/4.4/meta-viewport-large?application=axeAPI))
|
|
472
|
+
*/
|
|
473
|
+
metaViewportLarge: string;
|
|
474
|
+
/**
|
|
475
|
+
* - Ensures `<meta name="viewport">` does not disable text scaling and zooming
|
|
476
|
+
* - Zooming and scaling should not be disabled ([url](https://dequeuniversity.com/rules/axe/4.4/meta-viewport?application=axeAPI))
|
|
477
|
+
*/
|
|
478
|
+
metaViewport: string;
|
|
479
|
+
};
|
|
480
|
+
export declare const tables: {
|
|
481
|
+
/**
|
|
482
|
+
* - Ensures the scope attribute is used correctly on tables
|
|
483
|
+
* - scope attribute should be used correctly ([url](https://dequeuniversity.com/rules/axe/4.4/scope-attr-valid?application=axeAPI))
|
|
484
|
+
*/
|
|
485
|
+
scopeAttrValid: string;
|
|
486
|
+
/**
|
|
487
|
+
* - Ensure the `<caption>` element does not contain the same text as the summary attribute
|
|
488
|
+
* - tables should not have the same summary and caption ([url](https://dequeuniversity.com/rules/axe/4.4/table-duplicate-name?application=axeAPI))
|
|
489
|
+
*/
|
|
490
|
+
tableDuplicateName: string;
|
|
491
|
+
/**
|
|
492
|
+
* - Ensure that tables with a caption use the `<caption>` element.
|
|
493
|
+
* - Data or header cells must not be used to give caption to a data table. ([url](https://dequeuniversity.com/rules/axe/4.4/table-fake-caption?application=axeAPI))
|
|
494
|
+
*/
|
|
495
|
+
tableFakeCaption: string;
|
|
496
|
+
/**
|
|
497
|
+
* - Ensure that each non-empty data cell in a `<table>` larger than 3 by 3 has one or more table headers
|
|
498
|
+
* - Non-empty `<td>` elements in larger `<table>` must have an associated table header ([url](https://dequeuniversity.com/rules/axe/4.4/td-has-header?application=axeAPI))
|
|
499
|
+
*/
|
|
500
|
+
tdHasHeader: string;
|
|
501
|
+
/**
|
|
502
|
+
* - Ensure that each cell in a table that uses the headers attribute refers only to other cells in that table
|
|
503
|
+
* - Table cells that use the headers attribute must only refer to cells in the same table ([url](https://dequeuniversity.com/rules/axe/4.4/td-headers-attr?application=axeAPI))
|
|
504
|
+
*/
|
|
505
|
+
tdHeadersAttr: string;
|
|
506
|
+
/**
|
|
507
|
+
* - Ensure that `<th>` elements and elements with role=columnheader/rowheader have data cells they describe
|
|
508
|
+
* - Table headers in a data table must refer to data cells ([url](https://dequeuniversity.com/rules/axe/4.4/th-has-data-cells?application=axeAPI))
|
|
509
|
+
*/
|
|
510
|
+
thHasDataCells: string;
|
|
511
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a manually curated list of rules in `axe-core`,
|
|
3
|
+
* separated by their dependence on dynamic content instead
|
|
4
|
+
* of static HTML.
|
|
5
|
+
*
|
|
6
|
+
* Each rule should be placed in one and only one category.
|
|
7
|
+
* Categories are in order of least to most restrictive, so
|
|
8
|
+
* rules should be placed in the earliest category where they
|
|
9
|
+
* are still properly ignored near dynamic content
|
|
10
|
+
*/
|
|
11
|
+
declare const rules: {
|
|
12
|
+
/**
|
|
13
|
+
* These rules can be evaluated against any component.
|
|
14
|
+
*/
|
|
15
|
+
alwaysAllowed: string[];
|
|
16
|
+
/**
|
|
17
|
+
* These rules can't be resolved with a spread operator
|
|
18
|
+
* in the node's attributes
|
|
19
|
+
*/
|
|
20
|
+
requiresAttrs: string[];
|
|
21
|
+
/**
|
|
22
|
+
* These rules can't be resolved with dynamic content
|
|
23
|
+
* in the body of the node
|
|
24
|
+
*/
|
|
25
|
+
requiresChildren: string[];
|
|
26
|
+
/**
|
|
27
|
+
* These rules can be resolved by changing content in
|
|
28
|
+
* either the node body or its attributes
|
|
29
|
+
*/
|
|
30
|
+
requiresAttrsOrChildren: string[];
|
|
31
|
+
/**
|
|
32
|
+
* These rules cannot be supported until multiple files
|
|
33
|
+
* are analyzed at once. For now they are ignored.
|
|
34
|
+
*/
|
|
35
|
+
requiresParent: string[];
|
|
36
|
+
/**
|
|
37
|
+
* These rules should not be enforced to all users of
|
|
38
|
+
* the official Marko language server.
|
|
39
|
+
*/
|
|
40
|
+
blacklist: string[];
|
|
41
|
+
/**
|
|
42
|
+
* These are rules that cannot currently be validated, either
|
|
43
|
+
* because of limitations with JSDom + axe-core or with the
|
|
44
|
+
* current implementation of the language server.
|
|
45
|
+
*/
|
|
46
|
+
cannotValidate: string[];
|
|
47
|
+
};
|
|
48
|
+
export default rules;
|
package/dist/service/index.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { doChange, doChangeWatchedFiles, doClose, doOpen, get } from "../utils/text-documents";
|
|
2
|
+
export declare const documents: {
|
|
3
|
+
get: typeof get;
|
|
4
|
+
doChange: typeof doChange;
|
|
5
|
+
doOpen: typeof doOpen;
|
|
6
|
+
doClose: typeof doClose;
|
|
7
|
+
doChangeWatchedFiles: typeof doChangeWatchedFiles;
|
|
8
|
+
};
|
|
1
9
|
import type { Plugin } from "./types";
|
|
2
10
|
/**
|
|
3
11
|
* Facade to all embedded plugins, eg css, typescript and our own.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DidChangeTextDocumentParams, DidChangeWatchedFilesParams, DidCloseTextDocumentParams, DidOpenTextDocumentParams } from "vscode-languageserver";
|
|
2
2
|
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
3
|
export type FileChangeHandler = (document: TextDocument | undefined) => void;
|
|
4
4
|
export declare let projectVersion: number;
|
|
@@ -7,4 +7,7 @@ export declare function getAllOpen(): Set<TextDocument>;
|
|
|
7
7
|
export declare function get(uri: string): TextDocument | undefined;
|
|
8
8
|
export declare function exists(uri: string): boolean;
|
|
9
9
|
export declare function isOpen(doc: TextDocument): boolean;
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function doOpen(params: DidOpenTextDocumentParams): void;
|
|
11
|
+
export declare function doChange(params: DidChangeTextDocumentParams): void;
|
|
12
|
+
export declare function doClose(params: DidCloseTextDocumentParams): void;
|
|
13
|
+
export declare function doChangeWatchedFiles(params: DidChangeWatchedFilesParams): void;
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/language-server",
|
|
3
3
|
"description": "Marko Language Server",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"marko-language-server": "./bin.js"
|
|
7
7
|
},
|
|
8
8
|
"bugs": "https://github.com/marko-js/language-server/issues/new?template=Bug_report.md",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@babel/helper-validator-identifier": "^7.22.5",
|
|
11
|
-
"@marko/language-tools": "^2.0
|
|
11
|
+
"@marko/language-tools": "^2.1.0",
|
|
12
12
|
"@marko/babel-utils": "^5.22.1",
|
|
13
|
-
"@marko/compiler": "^5.28.
|
|
14
|
-
"@marko/translator-default": "^5.26.
|
|
13
|
+
"@marko/compiler": "^5.28.5",
|
|
14
|
+
"@marko/translator-default": "^5.26.5",
|
|
15
15
|
"htmljs-parser": "^5.5.0",
|
|
16
|
-
"marko": "^5.26.
|
|
16
|
+
"marko": "^5.26.5",
|
|
17
17
|
"prettier": "^2.8.8",
|
|
18
18
|
"prettier-plugin-marko": "^1.5.2",
|
|
19
19
|
"relative-import-path": "^1.0.0",
|
|
20
20
|
"strip-json-comments": "^3.1.1",
|
|
21
|
-
"typescript": "^5.1.
|
|
21
|
+
"typescript": "^5.1.6",
|
|
22
22
|
"vscode-css-languageservice": "^6.2.6",
|
|
23
23
|
"vscode-languageserver": "^8.1.0",
|
|
24
24
|
"vscode-languageserver-textdocument": "^1.0.8",
|
|
@@ -55,6 +55,8 @@
|
|
|
55
55
|
"url": "https://github.com/marko-js/language-server/tree/main/packages/language-server"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
|
-
"build": "tsc -b && tsx build.mts"
|
|
58
|
+
"build": "tsc -b && tsx build.mts",
|
|
59
|
+
"test": "mocha './src/**/__tests__/*.test.ts'",
|
|
60
|
+
"test:update": "mocha './src/**/__tests__/*.test.ts' --update"
|
|
59
61
|
}
|
|
60
62
|
}
|