-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathrules.js
More file actions
174 lines (170 loc) · 6.24 KB
/
Copy pathrules.js
File metadata and controls
174 lines (170 loc) · 6.24 KB
1
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import colorContrastFailure from '../rules/color-contrast-failure';
import underlinedText from '../rules/underlined-text';
import elementWithUnderline from '../checks/element-with-underline';
import elementIsAUTag from '../checks/element-is-u-tag';
import emptyParagraph from '../rules/empty-paragraph';
import paragraphNotEmpty from '../checks/paragraph-not-empty';
import possibleHeading from '../rules/possible-heading';
import paragraphStyledAsHeader from '../checks/paragraph-styled-as-header';
import textSmall from '../rules/text-small';
import textSizeTooSmall from '../checks/text-size-too-small';
import textJustified from '../rules/text-justified';
import textIsJustified from '../checks/text-is-justified';
import linkTargetBlank from '../rules/link_target_blank';
import linkTargetBlankWithoutInforming from '../checks/link-target-blank-without-informing';
import linkAmbiguousText from '../rules/link-ambiguous-text';
import hasAmbiguousText from '../checks/has-ambiguous-text';
import brokenAnchorLink from '../rules/broken-anchor-link';
import anchorExists from '../checks/anchor-exists';
import labelExtended from '../rules/extended/label';
import imageInputHasAlt from '../checks/image-input-has-alt';
import linkPDF from '../rules/link-pdf';
import linkMsOfficeFile from '../rules/link-ms-office-file';
import ariaHiddenValidUsage from '../checks/aria-hidden-valid-usage';
import ariaHiddenValidation from '../rules/aria-hidden-validation';
import ariaBrokenReference from '../rules/aria-broken-reference';
import ariaLabelNotFoundCheck from '../checks/aria-label-not-found';
import ariaDescribedByNotFoundCheck from '../checks/aria-describedby-not-found';
import ariaOwnsNotFoundCheck from '../checks/aria-owns-not-found';
import tableHasHeaders from '../checks/table-has-headers';
import missingTableHeader from '../rules/table-header-missing';
import headingTagEmpty from '../rules/empty-heading-tag';
import headingIsEmpty from '../checks/heading-is-empty';
import transcriptMissing from '../checks/has-transcript';
import missingTranscript from '../rules/missing-transcript';
import buttonEmpty from '../rules/empty-button';
import buttonIsEmpty from '../checks/button-is-empty';
import sliderDetected from '../checks/slider-detected';
import sliderPresent from '../rules/slider-present';
import isvideoDetected from '../checks/is-video-detected';
import videoPresent from '../rules/video-present';
import linkEmpty from '../rules/empty-link';
import linkIsEmpty from '../checks/link-is-empty';
import longdescValid from '../checks/longdesc-valid';
import longDescriptionInvalid from '../rules/long-description-invalid';
import emptyTableHeader from '../rules/empty-table-header';
import tableHeaderIsEmpty from '../checks/table-header-is-empty';
import imgAltMissing from '../rules/img-alt-missing';
import imgAltMissingCheck from '../checks/img-alt-missing-check';
import imgAltInvalid from '../rules/img-alt-invalid';
import imgAltInvalidCheck from '../checks/img-alt-invalid-check';
import imgAltRedundant from '../rules/img-alt-redundant';
import imgAltRedundantCheck from '../checks/img-alt-redundant-check';
import imgLinkedAltMissing from '../rules/img-linked-alt-missing';
import linkedImageAltPresent from '../checks/linked-image-alt-present';
import imgLinkedAltEmpty from '../rules/img-linked-alt-empty';
import linkedImageAltNotEmpty from '../checks/linked-image-alt-not-empty';
import imageAltLong from '../rules/img-alt-long';
import imgAltLongCheck from '../checks/img-alt-long-check';
import imgAltEmpty from '../rules/img-alt-empty';
import imgAltEmptyCheck from '../checks/img-alt-empty-check';
import linkNonHtmlFile from '../rules/link-non-html-file';
import linkPointsToHtml from '../checks/link-points-to-html';
import linkImproper from '../rules/link-improper';
import linkHasValidHrefOrRole from '../checks/link-has-valid-href-or-role';
import missingHeadings from '../rules/missing-headings';
import hasSubheadingsIfLongContent from '../checks/has-subheadings-if-long-content';
import imageAnimated from '../rules/img-animated';
import imageAnimatedCheck from '../checks/img-animated-check';
import alwaysFail from '../checks/always-fail';
// Define all the custom rules to be used.
export const rulesArray = [
colorContrastFailure,
underlinedText,
possibleHeading,
emptyParagraph,
textSmall,
textJustified,
linkTargetBlank,
linkAmbiguousText,
linkPDF,
linkMsOfficeFile,
brokenAnchorLink,
labelExtended,
missingTableHeader,
headingTagEmpty,
missingTranscript,
buttonEmpty,
sliderPresent,
videoPresent,
linkEmpty,
longDescriptionInvalid,
emptyTableHeader,
imgAltMissing,
imgAltInvalid,
imgAltRedundant,
imgLinkedAltMissing,
imgLinkedAltEmpty,
imageAltLong,
imgAltEmpty,
linkNonHtmlFile,
linkImproper,
missingHeadings,
imageAnimated,
ariaHiddenValidation,
ariaBrokenReference,
];
// Define all the custom checks to be used.
export const checksArray = [
alwaysFail,
elementIsAUTag,
elementWithUnderline,
paragraphStyledAsHeader,
paragraphNotEmpty,
textSizeTooSmall,
textIsJustified,
linkTargetBlankWithoutInforming,
hasAmbiguousText,
anchorExists,
imageInputHasAlt,
{
...ariaHiddenValidUsage,
options: {
exclusions: window?.scanOptions?.ruleExclusions?.aria_hidden || [],
},
},
tableHasHeaders,
headingIsEmpty,
transcriptMissing,
buttonIsEmpty,
sliderDetected,
isvideoDetected,
linkIsEmpty,
longdescValid,
tableHeaderIsEmpty,
imgAltMissingCheck,
imgAltInvalidCheck,
imgAltRedundantCheck,
linkedImageAltPresent,
linkedImageAltNotEmpty,
{
...imgAltLongCheck,
options: {
maxAltLength: window?.scanOptions?.maxAltLength || imgAltLongCheck.options.maxAltLength,
},
}, // This check supports an override of it's maxAltLength option when one is set in scanOptions.
imgAltEmptyCheck,
linkPointsToHtml,
linkHasValidHrefOrRole,
hasSubheadingsIfLongContent,
imageAnimatedCheck,
ariaLabelNotFoundCheck,
ariaDescribedByNotFoundCheck,
ariaOwnsNotFoundCheck,
];
// Define the standard axe core rules to be used.
export const standardRuleIdsArray = [
'meta-viewport',
'blink',
'marquee',
'document-title',
'tabindex',
'html-lang-valid',
'html-has-lang',
'form-field-multiple-labels',
'heading-order',
'frame-title',
'area-alt',
];
// Define custom rule IDs from the rules array.
export const customRuleIdsArray = rulesArray.map( ( rule ) => rule.id );