-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
93 lines (81 loc) · 3.65 KB
/
index.js
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
import * as accessibility from './src';
const excuteFunc = () => {
accessibility.htmlCheck();
accessibility.colorContrast();
accessibility.interactions();
accessibility.ariaRelated();
console.log("----------------------------------------------------")
console.log('ERRORS: ');
console.log('BASIC HTML ERRORS: ')
accessibility.errors.htmlError.forEach(arr => {
arr.forEach(err => {
console.log('%c Rule: ' + err.rule, 'color: #725afa');
console.log('%c Error: ' + err.error, 'color: #725afa');
console.log('%c Code: ' + err.snippet, 'color: #725afa');
console.log('%c Fix: ' + err.fix, 'color: #725afa');
console.log('-----------------------------')
})
})
console.log('COLOR CONTRAST ERRORS: ')
accessibility.errors.contrastError.forEach(err => {
console.log('%c Rule: ' + err.rule, 'color: #79f233');
console.log('%c Error: ' + err.error, 'color: #79f233');
console.log('%c Code: ' + err.snippet, 'color: #79f233');
console.log('%c Fix: ' + err.fix, 'color: #79f233');
console.log('-----------------------------')
})
console.log('INTERACTIONS BASED ERRORS: ')
accessibility.errors.interactionError.forEach(arr => {
arr.forEach(err => {
console.log('%c Rule: ' + err.rule, 'color: #ff8554');
console.log('%c Error: ' + err.error, 'color: #ff8554');
console.log('%c Code: ' + err.snippet, 'color: #ff8554');
console.log('%c Fix: ' + err.fix, 'color: #ff8554');
console.log('-----------------------------')
})
})
console.log('ARIA BASED ERRORS: ')
accessibility.errors.ariaError.forEach(arr => {
arr.forEach(err => {
console.log('%c Rule: ' + err.rule, 'color: #ed8aa7');
console.log('%c Error: ' + err.error, 'color: #ed8aa7');
console.log('%c Code: ' + err.snippet, 'color: #ed8aa7');
console.log('%c Fix: ' + err.fix, 'color: #ed8aa7');
console.log('-----------------------------')
})
})
console.log("----------------------------------------------------")
console.log('WARNINGS: ');
console.log('BASIC HTML WARNINGS: ')
accessibility.warnings.htmlWarning.forEach(arr => {
arr.forEach(err => {
console.log('%c Rule: ' + err.rule, 'color: #725afa');
console.log('%c Warning: ' + err.warning, 'color: #725afa');
console.log('%c Code: ' + err.snippet, 'color: #725afa');
console.log('%c Fix: ' + err.fix, 'color: #725afa');
console.log('-----------------------------')
})
})
console.log('INTERACTIONS BASED WARNINGS: ')
accessibility.warnings.interactionWarning.forEach(arr => {
arr.forEach(err => {
console.log('%c Rule: ' + err.rule, 'color: #ff8554');
console.log('%c Warning: ' + err.warning, 'color: #ff8554');
console.log('%c Code: ' + err.snippet, 'color: #ff8554');
console.log('%c Fix: ' + err.fix, 'color: #ff8554');
console.log('-----------------------------')
})
})
console.log('ARIA BASED WARNINGS: ')
accessibility.warnings.ariaWarning.forEach(arr => {
arr.forEach(err => {
console.log('%c Rule: ' + err.rule, 'color: #ed8aa7');
console.log('%c Warning: ' + err.warning, 'color: #ed8aa7');
console.log('%c Code: ' + err.snippet, 'color: #ed8aa7');
console.log('%c Fix: ' + err.fix, 'color: #ed8aa7');
console.log('-----------------------------')
})
})
}
console.clear();
excuteFunc();