@markuplint/types 3.5.0 → 3.6.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.
@@ -1,380 +1,380 @@
1
- "use strict";
1
+ 'use strict';
2
2
  // @ts-nocheck
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const check_autocomplete_1 = require("./check-autocomplete");
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+ const check_autocomplete_1 = require('./check-autocomplete');
5
5
  const check = (0, check_autocomplete_1.checkAutoComplete)();
6
6
  test('basic', () => {
7
- expect(check('on').matched).toBe(true);
8
- expect(check('on webauthn').matched).toBe(false);
9
- expect(check('off').matched).toBe(true);
10
- expect(check('off webauthn').matched).toBe(false);
11
- expect(check('name').matched).toBe(true);
12
- expect(check('given-name').matched).toBe(true);
13
- expect(check('given-name webauthn').matched).toBe(true);
14
- expect(check('given-name webauthun').matched).toBe(false);
15
- expect(check('section-').matched).toBe(true);
16
- expect(check('section-foo').matched).toBe(true);
17
- expect(check('section-foo webauthn').matched).toBe(true);
18
- expect(check('section-foo name').matched).toBe(true);
19
- expect(check('section-foo name webauthn').matched).toBe(true);
20
- expect(check('section-foo shipping name').matched).toBe(true);
21
- expect(check('section-foo billing name').matched).toBe(true);
22
- expect(check('section-foo billing home').matched).toBe(true);
23
- expect(check('section-foo billing work').matched).toBe(true);
24
- expect(check('section-foo billing home tel').matched).toBe(true);
25
- expect(check('section-foo billing work email').matched).toBe(true);
26
- expect(check('section-foo billing work email webauthn').matched).toBe(true);
27
- expect(check('shipping name').matched).toBe(true);
28
- expect(check('billing name').matched).toBe(true);
29
- expect(check('billing home').matched).toBe(true);
30
- expect(check('billing work').matched).toBe(true);
31
- expect(check('billing home tel').matched).toBe(true);
32
- expect(check('billing work email').matched).toBe(true);
33
- expect(check('billing work email webauthn').matched).toBe(true);
34
- expect(check('home tel').matched).toBe(true);
35
- expect(check('work email').matched).toBe(true);
36
- expect(check('work email webauthn').matched).toBe(true);
7
+ expect(check('on').matched).toBe(true);
8
+ expect(check('on webauthn').matched).toBe(false);
9
+ expect(check('off').matched).toBe(true);
10
+ expect(check('off webauthn').matched).toBe(false);
11
+ expect(check('name').matched).toBe(true);
12
+ expect(check('given-name').matched).toBe(true);
13
+ expect(check('given-name webauthn').matched).toBe(true);
14
+ expect(check('given-name webauthun').matched).toBe(false);
15
+ expect(check('section-').matched).toBe(true);
16
+ expect(check('section-foo').matched).toBe(true);
17
+ expect(check('section-foo webauthn').matched).toBe(true);
18
+ expect(check('section-foo name').matched).toBe(true);
19
+ expect(check('section-foo name webauthn').matched).toBe(true);
20
+ expect(check('section-foo shipping name').matched).toBe(true);
21
+ expect(check('section-foo billing name').matched).toBe(true);
22
+ expect(check('section-foo billing home').matched).toBe(true);
23
+ expect(check('section-foo billing work').matched).toBe(true);
24
+ expect(check('section-foo billing home tel').matched).toBe(true);
25
+ expect(check('section-foo billing work email').matched).toBe(true);
26
+ expect(check('section-foo billing work email webauthn').matched).toBe(true);
27
+ expect(check('shipping name').matched).toBe(true);
28
+ expect(check('billing name').matched).toBe(true);
29
+ expect(check('billing home').matched).toBe(true);
30
+ expect(check('billing work').matched).toBe(true);
31
+ expect(check('billing home tel').matched).toBe(true);
32
+ expect(check('billing work email').matched).toBe(true);
33
+ expect(check('billing work email webauthn').matched).toBe(true);
34
+ expect(check('home tel').matched).toBe(true);
35
+ expect(check('work email').matched).toBe(true);
36
+ expect(check('work email webauthn').matched).toBe(true);
37
37
  });
38
38
  test('unexpected-token', () => {
39
- expect(check('section-foo , name')).toStrictEqual({
40
- matched: false,
41
- raw: ',',
42
- offset: 12,
43
- length: 1,
44
- line: 1,
45
- column: 13,
46
- reason: 'unexpected-token',
47
- expects: [
48
- { type: 'const', value: 'billing' },
49
- { type: 'const', value: 'shipping' },
50
- { type: 'common', value: 'autofill field name' },
51
- ],
52
- candidate: undefined,
53
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
54
- });
39
+ expect(check('section-foo , name')).toStrictEqual({
40
+ matched: false,
41
+ raw: ',',
42
+ offset: 12,
43
+ length: 1,
44
+ line: 1,
45
+ column: 13,
46
+ reason: 'unexpected-token',
47
+ expects: [
48
+ { type: 'const', value: 'billing' },
49
+ { type: 'const', value: 'shipping' },
50
+ { type: 'common', value: 'autofill field name' },
51
+ ],
52
+ candidate: undefined,
53
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
54
+ });
55
55
  });
56
56
  test('unexpected-token', () => {
57
- expect(check('xxx')).toStrictEqual({
58
- matched: false,
59
- raw: 'xxx',
60
- offset: 0,
61
- length: 3,
62
- line: 1,
63
- column: 1,
64
- reason: 'unexpected-token',
65
- expects: [
66
- { type: 'common', value: 'autofill named group' },
67
- { type: 'common', value: 'autofill field name' },
68
- ],
69
- candidate: undefined,
70
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
71
- });
57
+ expect(check('xxx')).toStrictEqual({
58
+ matched: false,
59
+ raw: 'xxx',
60
+ offset: 0,
61
+ length: 3,
62
+ line: 1,
63
+ column: 1,
64
+ reason: 'unexpected-token',
65
+ expects: [
66
+ { type: 'common', value: 'autofill named group' },
67
+ { type: 'common', value: 'autofill field name' },
68
+ ],
69
+ candidate: undefined,
70
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
71
+ });
72
72
  });
73
73
  test('unexpected-token', () => {
74
- expect(check('section-foo neme')).toStrictEqual({
75
- matched: false,
76
- raw: 'neme',
77
- offset: 12,
78
- length: 4,
79
- line: 1,
80
- column: 13,
81
- reason: 'unexpected-token',
82
- expects: [
83
- { type: 'const', value: 'billing' },
84
- { type: 'const', value: 'shipping' },
85
- { type: 'common', value: 'autofill field name' },
86
- ],
87
- candidate: 'name',
88
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
89
- });
90
- expect(check('section-foo shipping neme')).toStrictEqual({
91
- matched: false,
92
- raw: 'neme',
93
- offset: 21,
94
- length: 4,
95
- line: 1,
96
- column: 22,
97
- reason: 'unexpected-token',
98
- expects: [
99
- { type: 'common', value: 'autofill field name' },
100
- { type: 'const', value: 'home' },
101
- { type: 'const', value: 'work' },
102
- { type: 'const', value: 'mobile' },
103
- { type: 'const', value: 'fax' },
104
- { type: 'const', value: 'pager' },
105
- ],
106
- candidate: 'name',
107
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
108
- });
109
- expect(check('section-foo shipping home name')).toStrictEqual({
110
- matched: false,
111
- raw: 'name',
112
- offset: 26,
113
- length: 4,
114
- line: 1,
115
- column: 27,
116
- reason: 'unexpected-token',
117
- expects: [
118
- { type: 'const', value: 'tel' },
119
- { type: 'const', value: 'tel-country-code' },
120
- { type: 'const', value: 'tel-national' },
121
- { type: 'const', value: 'tel-area-code' },
122
- { type: 'const', value: 'tel-local' },
123
- { type: 'const', value: 'tel-local-prefix' },
124
- { type: 'const', value: 'tel-local-suffix' },
125
- { type: 'const', value: 'tel-extension' },
126
- { type: 'const', value: 'email' },
127
- { type: 'const', value: 'impp' },
128
- ],
129
- candidate: undefined,
130
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-tel',
131
- });
132
- expect(check('section-foo shipping home emall')).toStrictEqual({
133
- matched: false,
134
- raw: 'emall',
135
- offset: 26,
136
- length: 5,
137
- line: 1,
138
- column: 27,
139
- reason: 'unexpected-token',
140
- expects: [
141
- { type: 'const', value: 'tel' },
142
- { type: 'const', value: 'tel-country-code' },
143
- { type: 'const', value: 'tel-national' },
144
- { type: 'const', value: 'tel-area-code' },
145
- { type: 'const', value: 'tel-local' },
146
- { type: 'const', value: 'tel-local-prefix' },
147
- { type: 'const', value: 'tel-local-suffix' },
148
- { type: 'const', value: 'tel-extension' },
149
- { type: 'const', value: 'email' },
150
- { type: 'const', value: 'impp' },
151
- ],
152
- candidate: 'email',
153
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-tel',
154
- });
74
+ expect(check('section-foo neme')).toStrictEqual({
75
+ matched: false,
76
+ raw: 'neme',
77
+ offset: 12,
78
+ length: 4,
79
+ line: 1,
80
+ column: 13,
81
+ reason: 'unexpected-token',
82
+ expects: [
83
+ { type: 'const', value: 'billing' },
84
+ { type: 'const', value: 'shipping' },
85
+ { type: 'common', value: 'autofill field name' },
86
+ ],
87
+ candidate: 'name',
88
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
89
+ });
90
+ expect(check('section-foo shipping neme')).toStrictEqual({
91
+ matched: false,
92
+ raw: 'neme',
93
+ offset: 21,
94
+ length: 4,
95
+ line: 1,
96
+ column: 22,
97
+ reason: 'unexpected-token',
98
+ expects: [
99
+ { type: 'common', value: 'autofill field name' },
100
+ { type: 'const', value: 'home' },
101
+ { type: 'const', value: 'work' },
102
+ { type: 'const', value: 'mobile' },
103
+ { type: 'const', value: 'fax' },
104
+ { type: 'const', value: 'pager' },
105
+ ],
106
+ candidate: 'name',
107
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
108
+ });
109
+ expect(check('section-foo shipping home name')).toStrictEqual({
110
+ matched: false,
111
+ raw: 'name',
112
+ offset: 26,
113
+ length: 4,
114
+ line: 1,
115
+ column: 27,
116
+ reason: 'unexpected-token',
117
+ expects: [
118
+ { type: 'const', value: 'tel' },
119
+ { type: 'const', value: 'tel-country-code' },
120
+ { type: 'const', value: 'tel-national' },
121
+ { type: 'const', value: 'tel-area-code' },
122
+ { type: 'const', value: 'tel-local' },
123
+ { type: 'const', value: 'tel-local-prefix' },
124
+ { type: 'const', value: 'tel-local-suffix' },
125
+ { type: 'const', value: 'tel-extension' },
126
+ { type: 'const', value: 'email' },
127
+ { type: 'const', value: 'impp' },
128
+ ],
129
+ candidate: undefined,
130
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-tel',
131
+ });
132
+ expect(check('section-foo shipping home emall')).toStrictEqual({
133
+ matched: false,
134
+ raw: 'emall',
135
+ offset: 26,
136
+ length: 5,
137
+ line: 1,
138
+ column: 27,
139
+ reason: 'unexpected-token',
140
+ expects: [
141
+ { type: 'const', value: 'tel' },
142
+ { type: 'const', value: 'tel-country-code' },
143
+ { type: 'const', value: 'tel-national' },
144
+ { type: 'const', value: 'tel-area-code' },
145
+ { type: 'const', value: 'tel-local' },
146
+ { type: 'const', value: 'tel-local-prefix' },
147
+ { type: 'const', value: 'tel-local-suffix' },
148
+ { type: 'const', value: 'tel-extension' },
149
+ { type: 'const', value: 'email' },
150
+ { type: 'const', value: 'impp' },
151
+ ],
152
+ candidate: 'email',
153
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-tel',
154
+ });
155
155
  });
156
156
  test('duplicated', () => {
157
- expect(check('name name')).toStrictEqual({
158
- matched: false,
159
- raw: 'name',
160
- offset: 5,
161
- length: 4,
162
- line: 1,
163
- column: 6,
164
- partName: 'the content of the list',
165
- reason: 'duplicated',
166
- expects: [{ type: 'format', value: 'autocomplete' }],
167
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete',
168
- });
169
- expect(check('on on')).toStrictEqual({
170
- matched: false,
171
- raw: 'on',
172
- offset: 3,
173
- length: 2,
174
- line: 1,
175
- column: 4,
176
- partName: 'the content of the list',
177
- reason: 'duplicated',
178
- expects: [{ type: 'format', value: 'autocomplete' }],
179
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete',
180
- });
157
+ expect(check('name name')).toStrictEqual({
158
+ matched: false,
159
+ raw: 'name',
160
+ offset: 5,
161
+ length: 4,
162
+ line: 1,
163
+ column: 6,
164
+ partName: 'the content of the list',
165
+ reason: 'duplicated',
166
+ expects: [{ type: 'format', value: 'autocomplete' }],
167
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete',
168
+ });
169
+ expect(check('on on')).toStrictEqual({
170
+ matched: false,
171
+ raw: 'on',
172
+ offset: 3,
173
+ length: 2,
174
+ line: 1,
175
+ column: 4,
176
+ partName: 'the content of the list',
177
+ reason: 'duplicated',
178
+ expects: [{ type: 'format', value: 'autocomplete' }],
179
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete',
180
+ });
181
181
  });
182
182
  test('extra-token', () => {
183
- expect(check('on off')).toStrictEqual({
184
- matched: false,
185
- raw: 'off',
186
- offset: 3,
187
- length: 3,
188
- line: 1,
189
- column: 4,
190
- reason: 'extra-token',
191
- expects: [{ type: 'format', value: 'autocomplete' }],
192
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
193
- });
194
- expect(check('off on')).toStrictEqual({
195
- matched: false,
196
- raw: 'on',
197
- offset: 4,
198
- length: 2,
199
- line: 1,
200
- column: 5,
201
- reason: 'extra-token',
202
- expects: [{ type: 'format', value: 'autocomplete' }],
203
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
204
- });
205
- expect(check('on name')).toStrictEqual({
206
- matched: false,
207
- raw: 'name',
208
- offset: 3,
209
- length: 4,
210
- line: 1,
211
- column: 4,
212
- reason: 'extra-token',
213
- expects: [{ type: 'format', value: 'autocomplete' }],
214
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
215
- });
216
- expect(check('name on')).toStrictEqual({
217
- matched: false,
218
- raw: 'on',
219
- offset: 5,
220
- length: 2,
221
- line: 1,
222
- column: 6,
223
- reason: 'extra-token',
224
- expects: [{ type: 'format', value: 'autocomplete' }],
225
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
226
- });
227
- expect(check('section-foo name on')).toStrictEqual({
228
- matched: false,
229
- raw: 'on',
230
- offset: 17,
231
- length: 2,
232
- line: 1,
233
- column: 18,
234
- reason: 'extra-token',
235
- expects: [{ type: 'format', value: 'autocomplete' }],
236
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
237
- });
238
- expect(check('section-foo billing name on')).toStrictEqual({
239
- matched: false,
240
- raw: 'on',
241
- offset: 25,
242
- length: 2,
243
- line: 1,
244
- column: 26,
245
- reason: 'extra-token',
246
- expects: [{ type: 'format', value: 'autocomplete' }],
247
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
248
- });
249
- expect(check('billing name on')).toStrictEqual({
250
- matched: false,
251
- raw: 'on',
252
- offset: 13,
253
- length: 2,
254
- line: 1,
255
- column: 14,
256
- reason: 'extra-token',
257
- expects: [{ type: 'format', value: 'autocomplete' }],
258
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
259
- });
260
- expect(check('tel on')).toStrictEqual({
261
- matched: false,
262
- raw: 'on',
263
- offset: 4,
264
- length: 2,
265
- line: 1,
266
- column: 5,
267
- reason: 'extra-token',
268
- expects: [{ type: 'format', value: 'autocomplete' }],
269
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
270
- });
271
- expect(check('home tel on')).toStrictEqual({
272
- matched: false,
273
- raw: 'on',
274
- offset: 9,
275
- length: 2,
276
- line: 1,
277
- column: 10,
278
- reason: 'extra-token',
279
- expects: [{ type: 'format', value: 'autocomplete' }],
280
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
281
- });
282
- expect(check('billing home tel on')).toStrictEqual({
283
- matched: false,
284
- raw: 'on',
285
- offset: 17,
286
- length: 2,
287
- line: 1,
288
- column: 18,
289
- reason: 'extra-token',
290
- expects: [{ type: 'format', value: 'autocomplete' }],
291
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
292
- });
293
- expect(check('billing home tel on')).toStrictEqual({
294
- matched: false,
295
- raw: 'on',
296
- offset: 17,
297
- length: 2,
298
- line: 1,
299
- column: 18,
300
- reason: 'extra-token',
301
- expects: [{ type: 'format', value: 'autocomplete' }],
302
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
303
- });
304
- expect(check('section-foo billing home tel on')).toStrictEqual({
305
- matched: false,
306
- raw: 'on',
307
- offset: 29,
308
- length: 2,
309
- line: 1,
310
- column: 30,
311
- reason: 'extra-token',
312
- expects: [{ type: 'format', value: 'autocomplete' }],
313
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
314
- });
315
- expect(check('section-foo home tel on')).toStrictEqual({
316
- matched: false,
317
- raw: 'on',
318
- offset: 21,
319
- length: 2,
320
- line: 1,
321
- column: 22,
322
- reason: 'extra-token',
323
- expects: [{ type: 'format', value: 'autocomplete' }],
324
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
325
- });
326
- expect(check('section-foo tel on')).toStrictEqual({
327
- matched: false,
328
- raw: 'on',
329
- offset: 16,
330
- length: 2,
331
- line: 1,
332
- column: 17,
333
- reason: 'extra-token',
334
- expects: [{ type: 'format', value: 'autocomplete' }],
335
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
336
- });
183
+ expect(check('on off')).toStrictEqual({
184
+ matched: false,
185
+ raw: 'off',
186
+ offset: 3,
187
+ length: 3,
188
+ line: 1,
189
+ column: 4,
190
+ reason: 'extra-token',
191
+ expects: [{ type: 'format', value: 'autocomplete' }],
192
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
193
+ });
194
+ expect(check('off on')).toStrictEqual({
195
+ matched: false,
196
+ raw: 'on',
197
+ offset: 4,
198
+ length: 2,
199
+ line: 1,
200
+ column: 5,
201
+ reason: 'extra-token',
202
+ expects: [{ type: 'format', value: 'autocomplete' }],
203
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
204
+ });
205
+ expect(check('on name')).toStrictEqual({
206
+ matched: false,
207
+ raw: 'name',
208
+ offset: 3,
209
+ length: 4,
210
+ line: 1,
211
+ column: 4,
212
+ reason: 'extra-token',
213
+ expects: [{ type: 'format', value: 'autocomplete' }],
214
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
215
+ });
216
+ expect(check('name on')).toStrictEqual({
217
+ matched: false,
218
+ raw: 'on',
219
+ offset: 5,
220
+ length: 2,
221
+ line: 1,
222
+ column: 6,
223
+ reason: 'extra-token',
224
+ expects: [{ type: 'format', value: 'autocomplete' }],
225
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
226
+ });
227
+ expect(check('section-foo name on')).toStrictEqual({
228
+ matched: false,
229
+ raw: 'on',
230
+ offset: 17,
231
+ length: 2,
232
+ line: 1,
233
+ column: 18,
234
+ reason: 'extra-token',
235
+ expects: [{ type: 'format', value: 'autocomplete' }],
236
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
237
+ });
238
+ expect(check('section-foo billing name on')).toStrictEqual({
239
+ matched: false,
240
+ raw: 'on',
241
+ offset: 25,
242
+ length: 2,
243
+ line: 1,
244
+ column: 26,
245
+ reason: 'extra-token',
246
+ expects: [{ type: 'format', value: 'autocomplete' }],
247
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
248
+ });
249
+ expect(check('billing name on')).toStrictEqual({
250
+ matched: false,
251
+ raw: 'on',
252
+ offset: 13,
253
+ length: 2,
254
+ line: 1,
255
+ column: 14,
256
+ reason: 'extra-token',
257
+ expects: [{ type: 'format', value: 'autocomplete' }],
258
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
259
+ });
260
+ expect(check('tel on')).toStrictEqual({
261
+ matched: false,
262
+ raw: 'on',
263
+ offset: 4,
264
+ length: 2,
265
+ line: 1,
266
+ column: 5,
267
+ reason: 'extra-token',
268
+ expects: [{ type: 'format', value: 'autocomplete' }],
269
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
270
+ });
271
+ expect(check('home tel on')).toStrictEqual({
272
+ matched: false,
273
+ raw: 'on',
274
+ offset: 9,
275
+ length: 2,
276
+ line: 1,
277
+ column: 10,
278
+ reason: 'extra-token',
279
+ expects: [{ type: 'format', value: 'autocomplete' }],
280
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
281
+ });
282
+ expect(check('billing home tel on')).toStrictEqual({
283
+ matched: false,
284
+ raw: 'on',
285
+ offset: 17,
286
+ length: 2,
287
+ line: 1,
288
+ column: 18,
289
+ reason: 'extra-token',
290
+ expects: [{ type: 'format', value: 'autocomplete' }],
291
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
292
+ });
293
+ expect(check('billing home tel on')).toStrictEqual({
294
+ matched: false,
295
+ raw: 'on',
296
+ offset: 17,
297
+ length: 2,
298
+ line: 1,
299
+ column: 18,
300
+ reason: 'extra-token',
301
+ expects: [{ type: 'format', value: 'autocomplete' }],
302
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
303
+ });
304
+ expect(check('section-foo billing home tel on')).toStrictEqual({
305
+ matched: false,
306
+ raw: 'on',
307
+ offset: 29,
308
+ length: 2,
309
+ line: 1,
310
+ column: 30,
311
+ reason: 'extra-token',
312
+ expects: [{ type: 'format', value: 'autocomplete' }],
313
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
314
+ });
315
+ expect(check('section-foo home tel on')).toStrictEqual({
316
+ matched: false,
317
+ raw: 'on',
318
+ offset: 21,
319
+ length: 2,
320
+ line: 1,
321
+ column: 22,
322
+ reason: 'extra-token',
323
+ expects: [{ type: 'format', value: 'autocomplete' }],
324
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
325
+ });
326
+ expect(check('section-foo tel on')).toStrictEqual({
327
+ matched: false,
328
+ raw: 'on',
329
+ offset: 16,
330
+ length: 2,
331
+ line: 1,
332
+ column: 17,
333
+ reason: 'extra-token',
334
+ expects: [{ type: 'format', value: 'autocomplete' }],
335
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
336
+ });
337
337
  });
338
338
  test('duplicated section', () => {
339
- expect(check('section-foo section-bar')).toStrictEqual({
340
- matched: false,
341
- raw: 'section-bar',
342
- offset: 12,
343
- length: 11,
344
- line: 1,
345
- column: 13,
346
- partName: 'autofill named group',
347
- reason: 'duplicated',
348
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-section',
349
- });
339
+ expect(check('section-foo section-bar')).toStrictEqual({
340
+ matched: false,
341
+ raw: 'section-bar',
342
+ offset: 12,
343
+ length: 11,
344
+ line: 1,
345
+ column: 13,
346
+ partName: 'autofill named group',
347
+ reason: 'duplicated',
348
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-section',
349
+ });
350
350
  });
351
351
  test('duplicated part', () => {
352
- expect(check('shipping billing')).toStrictEqual({
353
- matched: false,
354
- raw: 'billing',
355
- offset: 9,
356
- length: 7,
357
- line: 1,
358
- column: 10,
359
- reason: 'duplicated',
360
- expects: [{ type: 'format', value: 'autocomplete' }],
361
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-shipping',
362
- });
352
+ expect(check('shipping billing')).toStrictEqual({
353
+ matched: false,
354
+ raw: 'billing',
355
+ offset: 9,
356
+ length: 7,
357
+ line: 1,
358
+ column: 10,
359
+ reason: 'duplicated',
360
+ expects: [{ type: 'format', value: 'autocomplete' }],
361
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-shipping',
362
+ });
363
363
  });
364
364
  test('typo', () => {
365
- expect(check('secsion-foo name')).toStrictEqual({
366
- matched: false,
367
- raw: 'secsion-foo',
368
- offset: 0,
369
- length: 11,
370
- line: 1,
371
- column: 1,
372
- reason: 'unexpected-token',
373
- expects: [
374
- { type: 'common', value: 'autofill named group' },
375
- { type: 'common', value: 'autofill field name' },
376
- ],
377
- candidate: 'section-foo',
378
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
379
- });
365
+ expect(check('secsion-foo name')).toStrictEqual({
366
+ matched: false,
367
+ raw: 'secsion-foo',
368
+ offset: 0,
369
+ length: 11,
370
+ line: 1,
371
+ column: 1,
372
+ reason: 'unexpected-token',
373
+ expects: [
374
+ { type: 'common', value: 'autofill named group' },
375
+ { type: 'common', value: 'autofill field name' },
376
+ ],
377
+ candidate: 'section-foo',
378
+ ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
379
+ });
380
380
  });