File tree Expand file tree Collapse file tree 1 file changed +8
-23
lines changed Expand file tree Collapse file tree 1 file changed +8
-23
lines changed Original file line number Diff line number Diff line change 1- # Enable ONLY these rules (this disables all other built-in rules)
21only_rules :
3- - a11y_swiftui_image_missing_label
4- - a11y_button_missing_label
5- - a11y_empty_text
2+ - accessibility_label_for_image
3+ - accessibility_trait_for_button
64
7- # Define your custom a11y rules
8- custom_rules :
9- a11y_swiftui_image_missing_label :
10- name : " SwiftUI Image Missing Accessibility Label"
11- regex : " \\ bImage\\ ((?!.*accessibilityLabel)"
12- message : " SwiftUI Image needs accessibilityLabel() or .accessibilityHidden(true)"
13- severity : error
14-
15- a11y_button_missing_label :
16- name : " SwiftUI Button Missing Accessibility Label"
17- regex : " Button\\ s*\\ {[^}]*\\ }\\ s*(?!.*accessibilityLabel)"
18- message : " SwiftUI Button must have accessibilityLabel() or visible text."
19- severity : error
20-
21- a11y_empty_text :
22- name : " Empty Text() is bad for accessibility"
23- regex : " Text\\ ([\" ']{2}\\ )"
24- message : " Empty Text() is not accessible — use hidden or provide a label."
25- severity : error
5+ # Configure the rules
6+ accessibility_label_for_image :
7+ severity : error
8+
9+ accessibility_trait_for_button :
10+ severity : error
You can’t perform that action at this time.
0 commit comments