-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathlinthtml.config.js
More file actions
116 lines (112 loc) · 4.73 KB
/
Copy pathlinthtml.config.js
File metadata and controls
116 lines (112 loc) · 4.73 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
const svgCamelCaseTags = [
'clipPath', 'textPath', 'linearGradient', 'radialGradient', 'foreignObject',
'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix',
'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood',
'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge',
'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting',
'feSpotLight', 'feTile', 'feTurbulence', 'animateTransform', 'animateMotion',
];
const svgCamelCaseAttributes = [
'viewBox', 'preserveAspectRatio', 'xlink:href', 'xmlns:xlink',
'gradientTransform', 'gradientUnits', 'patternTransform', 'patternUnits', 'patternContentUnits',
'markerWidth', 'markerHeight', 'markerUnits', 'refX', 'refY',
'clipPathUnits', 'maskUnits', 'maskContentUnits',
'attributeName', 'attributeType', 'repeatCount', 'repeatDur', 'textLength', 'lengthAdjust',
'stdDeviation', 'baseFrequency', 'numOctaves', 'stitchTiles', 'surfaceScale',
'kernelMatrix', 'kernelUnitLength', 'edgeMode', 'specularConstant', 'specularExponent',
'pointsAtX', 'pointsAtY', 'pointsAtZ', 'pathLength', 'startOffset', 'tableValues',
'spreadMethod', 'primitiveUnits', 'filterUnits',
];
const allowedInputTypes = [
'button', 'checkbox', 'color', 'date', 'datetime-local', 'email', 'file',
'hidden', 'image', 'month', 'number', 'password', 'radio', 'range', 'reset',
'search', 'submit', 'tel', 'text', 'time', 'url', 'week',
];
export default {
'plugins': ['linthtml-rules-htmlacademy'],
'attr-name-ignore-regex': `^(${svgCamelCaseAttributes.join('|')})$`,
'rules': {
'htmlacademy/a-target-rel': true,
'htmlacademy/aria-label-misuse': true,
'htmlacademy/attr-delimiter': true,
'htmlacademy/attr-order': true,
'htmlacademy/attr-req-value': [true, {ignore: ['alt']}],
'htmlacademy/attribute-allowed-values': [true, {
input: {attributes: {type: {enum: allowedInputTypes}}},
}],
'htmlacademy/ban-url-spaces': true,
'htmlacademy/boolean-attr-no-value': true,
'htmlacademy/charset-position': true,
'htmlacademy/form-action-attribute': true,
'htmlacademy/head-meta-charset': true,
'htmlacademy/heading-level': true,
'htmlacademy/icon-button-aria-label': true,
'htmlacademy/id-no-dup': true,
'htmlacademy/input-name-unique': true,
'htmlacademy/input-req-label': true,
'htmlacademy/label-req-for': true,
'htmlacademy/label-req-text': true,
'htmlacademy/link-req-content': true,
'htmlacademy/no-blocking-script': true,
'htmlacademy/no-double-br': true,
'htmlacademy/no-px-size': true,
'htmlacademy/replaced-elements-req-dimensions': true,
'htmlacademy/req-charset-utf': true,
'htmlacademy/req-head-styles': true,
'htmlacademy/req-mailto': true,
'htmlacademy/req-meta-viewport': true,
'htmlacademy/req-preload-font': true,
'htmlacademy/req-single-styles': true,
'htmlacademy/req-source-width-height': true,
'htmlacademy/req-stylesheet-link': true,
'htmlacademy/req-submit-button': true,
'htmlacademy/req-tags-presence': [true, ['h1', 'main']],
'htmlacademy/req-webp-in-picture': true,
'htmlacademy/section-has-heading': true,
'htmlacademy/space-between-comments': [true, 'space'],
'htmlacademy/svg-role-img': true,
'htmlacademy/tag-forbid-attr': [true, {
link: [{name: 'type', value: 'text/css'}],
script: [{name: 'type', value: 'text/javascript'}],
}],
'htmlacademy/tag-name-lowercase': [true, {ignore: svgCamelCaseTags}],
'htmlacademy/tag-req-attr': [true, {
a: [{name: 'href'}],
button: [{name: 'type'}],
form: [{name: 'method'}],
input: [{name: 'name', ignore: {type: 'submit'}}],
select: [{name: 'name'}],
source: [{name: 'type'}],
textarea: [{name: 'name'}],
time: [{name: 'datetime'}],
}],
'htmlacademy/tag-self-close': [true, 'never'],
'attr-name-style': [true, 'dash'],
'attr-no-dup': true,
'attr-no-unsafe-char': true,
'attr-quote-style': [true, 'double'],
'attr-validate': true,
'class-no-dup': true,
'doctype-first': true,
'doctype-html5': true,
'fieldset-contains-legend': true,
'fig-req-figcaption': true,
'focusable-tabindex-style': true,
'head-req-title': true,
'head-valid-content-model': true,
'html-req-lang': true,
'html-valid-content-model': true,
'id-style': [true, 'dash'],
'img-req-alt': [true, 'allownull'],
'img-req-src': true,
'input-btn-req-value-or-title': true,
'input-radio-req-name': true,
'label-no-enc-textarea-or-select': true,
'lang-style': [true, 'case'],
'no-surrounding-whitespace': true,
'tag-bans': [true, 'style'],
'tag-close': true,
'tag-name-match': true,
'title-no-dup': true,
},
};