@markuplint/types 3.0.0-dev.25 → 3.0.0-dev.300

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.
Files changed (173) hide show
  1. package/README.md +63 -61
  2. package/lib/check-multi-types.d.ts +2 -2
  3. package/lib/check-multi-types.js +9 -13
  4. package/lib/check.d.ts +7 -6
  5. package/lib/check.js +20 -30
  6. package/lib/css-syntax.d.ts +1 -1
  7. package/lib/css-syntax.js +60 -63
  8. package/lib/debug.js +2 -6
  9. package/lib/defs.d.ts +1 -1
  10. package/lib/defs.js +163 -91
  11. package/lib/enum.d.ts +4 -3
  12. package/lib/enum.js +7 -12
  13. package/lib/get-candidate.d.ts +1 -1
  14. package/lib/get-candidate.js +3 -8
  15. package/lib/index.d.ts +3 -3
  16. package/lib/index.js +3 -6
  17. package/lib/keyword-type.d.ts +2 -2
  18. package/lib/keyword-type.js +17 -21
  19. package/lib/list.d.ts +4 -3
  20. package/lib/list.js +9 -13
  21. package/lib/match-result.d.ts +4 -4
  22. package/lib/match-result.js +6 -12
  23. package/lib/number.d.ts +3 -3
  24. package/lib/number.js +11 -15
  25. package/lib/primitive/index.d.ts +7 -7
  26. package/lib/primitive/index.js +7 -17
  27. package/lib/primitive/is-float.js +1 -5
  28. package/lib/primitive/is-int.js +1 -5
  29. package/lib/primitive/is-non-zero-uint.js +1 -5
  30. package/lib/primitive/is-quantity.d.ts +1 -1
  31. package/lib/primitive/is-quantity.js +9 -13
  32. package/lib/primitive/is-uint.d.ts +1 -1
  33. package/lib/primitive/is-uint.js +1 -5
  34. package/lib/primitive/range.js +1 -5
  35. package/lib/primitive/split-unit.js +3 -7
  36. package/lib/rfc/is-bcp-47.d.ts +1 -1
  37. package/lib/rfc/is-bcp-47.js +3 -7
  38. package/lib/token/index.d.ts +2 -2
  39. package/lib/token/index.js +2 -7
  40. package/lib/token/token-collection.d.ts +13 -13
  41. package/lib/token/token-collection.js +55 -50
  42. package/lib/token/token.d.ts +11 -10
  43. package/lib/token/token.js +16 -24
  44. package/lib/token/types.d.ts +3 -0
  45. package/lib/types.d.ts +47 -46
  46. package/lib/types.js +1 -2
  47. package/lib/types.schema.d.ts +2 -2
  48. package/lib/types.schema.js +1 -3
  49. package/lib/w3c/check-serialized-permissions-policy.d.ts +1 -1
  50. package/lib/w3c/check-serialized-permissions-policy.js +16 -20
  51. package/lib/whatwg/check-autocomplete.d.ts +1 -1
  52. package/lib/whatwg/check-autocomplete.js +28 -32
  53. package/lib/whatwg/check-datetime/date-string.d.ts +1 -1
  54. package/lib/whatwg/check-datetime/date-string.js +9 -13
  55. package/lib/whatwg/check-datetime/datetime-tokens.d.ts +1 -1
  56. package/lib/whatwg/check-datetime/datetime-tokens.js +43 -46
  57. package/lib/whatwg/check-datetime/duration-string.d.ts +1 -1
  58. package/lib/whatwg/check-datetime/duration-string.js +48 -44
  59. package/lib/whatwg/check-datetime/global-date-and-time-string.d.ts +1 -1
  60. package/lib/whatwg/check-datetime/global-date-and-time-string.js +17 -21
  61. package/lib/whatwg/check-datetime/index.d.ts +1 -1
  62. package/lib/whatwg/check-datetime/index.js +25 -29
  63. package/lib/whatwg/check-datetime/local-date-and-time-string.d.ts +1 -1
  64. package/lib/whatwg/check-datetime/local-date-and-time-string.js +25 -26
  65. package/lib/whatwg/check-datetime/month-string.d.ts +1 -1
  66. package/lib/whatwg/check-datetime/month-string.js +9 -13
  67. package/lib/whatwg/check-datetime/time-string.d.ts +1 -1
  68. package/lib/whatwg/check-datetime/time-string.js +9 -13
  69. package/lib/whatwg/check-datetime/time-zone-offset-string.d.ts +3 -3
  70. package/lib/whatwg/check-datetime/time-zone-offset-string.js +16 -21
  71. package/lib/whatwg/check-datetime/week-string.d.ts +1 -1
  72. package/lib/whatwg/check-datetime/week-string.js +9 -13
  73. package/lib/whatwg/check-datetime/year-string.d.ts +1 -1
  74. package/lib/whatwg/check-datetime/year-string.js +9 -13
  75. package/lib/whatwg/check-datetime/yearless-date-string.d.ts +1 -1
  76. package/lib/whatwg/check-datetime/yearless-date-string.js +9 -13
  77. package/lib/whatwg/check-mime-type.d.ts +1 -1
  78. package/lib/whatwg/check-mime-type.js +12 -18
  79. package/lib/whatwg/is-abs-url.d.ts +1 -1
  80. package/lib/whatwg/is-abs-url.js +1 -5
  81. package/lib/whatwg/is-browser-context-name.d.ts +3 -1
  82. package/lib/whatwg/is-browser-context-name.js +3 -5
  83. package/lib/whatwg/is-custom-element-name.d.ts +1 -1
  84. package/lib/whatwg/is-custom-element-name.js +1 -5
  85. package/lib/whatwg/is-itemprop-name.d.ts +1 -1
  86. package/lib/whatwg/is-itemprop-name.js +2 -6
  87. package/lib/whatwg/is-navigable-target-name.d.ts +11 -0
  88. package/lib/whatwg/is-navigable-target-name.js +20 -0
  89. package/package.json +19 -14
  90. package/types.schema.json +314 -311
  91. package/gen/specific-schema.json +0 -98
  92. package/gen/types.ts +0 -66
  93. package/lib/check.spec.js +0 -76
  94. package/lib/css-syntax.spec.d.ts +0 -1
  95. package/lib/css-syntax.spec.js +0 -157
  96. package/lib/list.spec.d.ts +0 -1
  97. package/lib/list.spec.js +0 -129
  98. package/lib/primitive/index.spec.d.ts +0 -1
  99. package/lib/primitive/index.spec.js +0 -62
  100. package/lib/rfc/is-bcp-47.spec.d.ts +0 -1
  101. package/lib/rfc/is-bcp-47.spec.js +0 -19
  102. package/lib/token/token-collection.spec.d.ts +0 -1
  103. package/lib/token/token-collection.spec.js +0 -144
  104. package/lib/w3c/check-serialized-permissions-policy.spec.d.ts +0 -1
  105. package/lib/w3c/check-serialized-permissions-policy.spec.js +0 -34
  106. package/lib/whatwg/check-autocomplete.spec.d.ts +0 -1
  107. package/lib/whatwg/check-autocomplete.spec.js +0 -379
  108. package/lib/whatwg/check-datetime/index.spec.d.ts +0 -1
  109. package/lib/whatwg/check-datetime/index.spec.js +0 -318
  110. package/lib/whatwg/check-mime-type.spec.d.ts +0 -1
  111. package/lib/whatwg/check-mime-type.spec.js +0 -58
  112. package/lib/whatwg/is-abs-url.spec.d.ts +0 -1
  113. package/lib/whatwg/is-abs-url.spec.js +0 -8
  114. package/patches/css-tree+2.3.1.patch +0 -23
  115. package/src/check-multi-types.ts +0 -35
  116. package/src/check.spec.ts +0 -83
  117. package/src/check.ts +0 -48
  118. package/src/css-syntax.spec.ts +0 -167
  119. package/src/css-syntax.ts +0 -188
  120. package/src/debug.ts +0 -3
  121. package/src/defs.ts +0 -811
  122. package/src/enum.ts +0 -25
  123. package/src/get-candidate.ts +0 -24
  124. package/src/index.ts +0 -3
  125. package/src/keyword-type.ts +0 -64
  126. package/src/list.spec.ts +0 -133
  127. package/src/list.ts +0 -34
  128. package/src/match-result.ts +0 -49
  129. package/src/number.ts +0 -46
  130. package/src/primitive/index.spec.ts +0 -65
  131. package/src/primitive/index.ts +0 -7
  132. package/src/primitive/is-float.ts +0 -8
  133. package/src/primitive/is-int.ts +0 -8
  134. package/src/primitive/is-non-zero-uint.ts +0 -8
  135. package/src/primitive/is-quantity.ts +0 -38
  136. package/src/primitive/is-uint.ts +0 -15
  137. package/src/primitive/range.ts +0 -14
  138. package/src/primitive/split-unit.ts +0 -20
  139. package/src/rfc/is-bcp-47.spec.ts +0 -23
  140. package/src/rfc/is-bcp-47.ts +0 -13
  141. package/src/token/index.ts +0 -2
  142. package/src/token/token-collection.spec.ts +0 -147
  143. package/src/token/token-collection.ts +0 -444
  144. package/src/token/token.ts +0 -144
  145. package/src/types.schema.ts +0 -1113
  146. package/src/types.ts +0 -118
  147. package/src/w3c/check-serialized-permissions-policy.spec.ts +0 -38
  148. package/src/w3c/check-serialized-permissions-policy.ts +0 -303
  149. package/src/whatwg/check-autocomplete.spec.ts +0 -387
  150. package/src/whatwg/check-autocomplete.ts +0 -380
  151. package/src/whatwg/check-datetime/date-string.ts +0 -44
  152. package/src/whatwg/check-datetime/datetime-tokens.ts +0 -600
  153. package/src/whatwg/check-datetime/duration-string.ts +0 -399
  154. package/src/whatwg/check-datetime/global-date-and-time-string.ts +0 -96
  155. package/src/whatwg/check-datetime/index.spec.ts +0 -333
  156. package/src/whatwg/check-datetime/index.ts +0 -36
  157. package/src/whatwg/check-datetime/local-date-and-time-string.ts +0 -163
  158. package/src/whatwg/check-datetime/month-string.ts +0 -31
  159. package/src/whatwg/check-datetime/time-string.ts +0 -49
  160. package/src/whatwg/check-datetime/time-zone-offset-string.ts +0 -93
  161. package/src/whatwg/check-datetime/week-string.ts +0 -41
  162. package/src/whatwg/check-datetime/year-string.ts +0 -26
  163. package/src/whatwg/check-datetime/yearless-date-string.ts +0 -38
  164. package/src/whatwg/check-mime-type.spec.ts +0 -59
  165. package/src/whatwg/check-mime-type.ts +0 -46
  166. package/src/whatwg/is-abs-url.spec.ts +0 -8
  167. package/src/whatwg/is-abs-url.ts +0 -31
  168. package/src/whatwg/is-browser-context-name.ts +0 -16
  169. package/src/whatwg/is-custom-element-name.ts +0 -76
  170. package/src/whatwg/is-itemprop-name.ts +0 -17
  171. package/tsconfig.test.json +0 -3
  172. package/tsconfig.tsbuildinfo +0 -1
  173. /package/lib/{check.spec.d.ts → token/types.js} +0 -0
@@ -1,144 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const token_collection_1 = require("./token-collection");
4
- const _1 = require(".");
5
- test('parse', () => {
6
- expect(new token_collection_1.TokenCollection(' a b c ').toJSON()).toStrictEqual([
7
- {
8
- offset: 0,
9
- type: 13,
10
- value: ' ',
11
- },
12
- {
13
- offset: 1,
14
- type: 1,
15
- value: 'a',
16
- },
17
- {
18
- offset: 2,
19
- type: 13,
20
- value: ' ',
21
- },
22
- {
23
- offset: 4,
24
- type: 1,
25
- value: 'b',
26
- },
27
- {
28
- offset: 5,
29
- type: 13,
30
- value: ' ',
31
- },
32
- {
33
- offset: 8,
34
- type: 1,
35
- value: 'c',
36
- },
37
- {
38
- offset: 9,
39
- type: 13,
40
- value: ' ',
41
- },
42
- ]);
43
- });
44
- test('parse comma separator', () => {
45
- expect(new token_collection_1.TokenCollection('a,, ,b,cde', { separator: 'comma' }).toJSON()).toStrictEqual([
46
- {
47
- offset: 0,
48
- type: 1,
49
- value: 'a',
50
- },
51
- {
52
- offset: 1,
53
- type: 18,
54
- value: ',',
55
- },
56
- {
57
- offset: 2,
58
- type: 18,
59
- value: ',',
60
- },
61
- {
62
- offset: 3,
63
- type: 13,
64
- value: ' ',
65
- },
66
- {
67
- offset: 4,
68
- type: 18,
69
- value: ',',
70
- },
71
- {
72
- offset: 5,
73
- type: 1,
74
- value: 'b',
75
- },
76
- {
77
- offset: 6,
78
- type: 18,
79
- value: ',',
80
- },
81
- {
82
- offset: 7,
83
- type: 1,
84
- value: 'cde',
85
- },
86
- ]);
87
- });
88
- test('A comma is an ident if the comma is not a separator', () => {
89
- expect(new token_collection_1.TokenCollection('a ,cde , f').toJSON()).toStrictEqual([
90
- {
91
- offset: 0,
92
- type: 1,
93
- value: 'a',
94
- },
95
- {
96
- offset: 1,
97
- type: 13,
98
- value: ' ',
99
- },
100
- {
101
- offset: 2,
102
- type: 1,
103
- value: ',cde',
104
- },
105
- {
106
- offset: 6,
107
- type: 13,
108
- value: ' ',
109
- },
110
- {
111
- offset: 7,
112
- type: 1,
113
- value: ',',
114
- },
115
- {
116
- offset: 8,
117
- type: 13,
118
- value: ' ',
119
- },
120
- {
121
- offset: 9,
122
- type: 1,
123
- value: 'f',
124
- },
125
- ]);
126
- });
127
- test('getConsecutiveToken', () => {
128
- var _a;
129
- expect(new token_collection_1.TokenCollection('a,b,c', { separator: 'comma' }).getConsecutiveToken(_1.Token.Comma)).toBeFalsy();
130
- expect(new token_collection_1.TokenCollection('a,,b', { separator: 'comma' }).getConsecutiveToken(_1.Token.Comma)).toBeTruthy();
131
- expect((_a = new token_collection_1.TokenCollection('a,,b', { separator: 'comma' }).getConsecutiveToken(_1.Token.Comma)) === null || _a === void 0 ? void 0 : _a.offset).toBe(2);
132
- });
133
- test('fromPatterns', () => {
134
- const patterns = [/\+|-/, /[0-9]{2}/, /:?/, /[0-9]{2}/];
135
- expect(token_collection_1.TokenCollection.fromPatterns('+00:00', patterns).map(t => t.value)).toStrictEqual(['+', '00', ':', '00']);
136
- expect(token_collection_1.TokenCollection.fromPatterns('+0000', patterns).map(t => t.value)).toStrictEqual(['+', '00', '', '00']);
137
- expect(token_collection_1.TokenCollection.fromPatterns('+00/00', patterns).map(t => t.value)).toStrictEqual([
138
- '+',
139
- '00',
140
- '',
141
- '',
142
- '/00',
143
- ]);
144
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,34 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const check_serialized_permissions_policy_1 = require("./check-serialized-permissions-policy");
5
- const check = (0, check_serialized_permissions_policy_1.checkSerializedPermissionsPolicy)();
6
- test('checkSerializedPermissionsPolicy', () => {
7
- expect(check('').reason).toBe('empty-token');
8
- expect(check(' ').reason).toBe('unexpected-token');
9
- // expect(check('a').reason).toBe('missing-token');
10
- expect(check('a').matched).toBe(true); // Current supported
11
- expect(check('a:').reason).toBe('unexpected-token');
12
- // expect(check('a ').reason).toBe('missing-token'); // Current supported
13
- expect(check('a ').matched).toBe(true);
14
- expect(check('a a').reason).toBe('unexpected-token');
15
- expect(check('a *').matched).toBe(true);
16
- expect(check('a *a').reason).toBe('unexpected-token');
17
- expect(check('a none').reason).toBe('missing-token');
18
- expect(check("a 'none'").matched).toBe(true);
19
- expect(check('a https://markuplint.dev').matched).toBe(true);
20
- expect(check('a https://markuplint.dev/path/to').reason).toBe('extra-token');
21
- expect(check('a https://マルチバイト.abc.xyz').reason).toBe('must-be-serialized');
22
- expect(check('a * https://markuplint.dev').matched).toBe(true);
23
- expect(check("a * https://markuplint.dev 'none'").matched).toBe(true);
24
- // expect(check("a * https://markuplint.dev 'none';b").reason).toBe('missing-token');
25
- expect(check("a * https://markuplint.dev 'none';b").matched).toBe(true); // Current supported
26
- // expect(check("a * https://markuplint.dev 'none';b ").reason).toBe('missing-token');
27
- expect(check("a * https://markuplint.dev 'none';b ").matched).toBe(true); // Current supported
28
- expect(check("a * https://markuplint.dev 'none';b *").matched).toBe(true);
29
- expect(check("a * https://markuplint.dev 'none';b *;c 'none'").matched).toBe(true);
30
- expect(check("a * https://markuplint.dev 'none'; b *; c 'none'").matched).toBe(true);
31
- });
32
- test('YouTube embed', () => {
33
- expect(check('accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture').matched).toBe(true);
34
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,379 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const check_autocomplete_1 = require("./check-autocomplete");
4
- const check = (0, check_autocomplete_1.checkAutoComplete)();
5
- test('basic', () => {
6
- expect(check('on').matched).toBe(true);
7
- expect(check('on webauthn').matched).toBe(false);
8
- expect(check('off').matched).toBe(true);
9
- expect(check('off webauthn').matched).toBe(false);
10
- expect(check('name').matched).toBe(true);
11
- expect(check('given-name').matched).toBe(true);
12
- expect(check('given-name webauthn').matched).toBe(true);
13
- expect(check('given-name webauthun').matched).toBe(false);
14
- expect(check('section-').matched).toBe(true);
15
- expect(check('section-foo').matched).toBe(true);
16
- expect(check('section-foo webauthn').matched).toBe(true);
17
- expect(check('section-foo name').matched).toBe(true);
18
- expect(check('section-foo name webauthn').matched).toBe(true);
19
- expect(check('section-foo shipping name').matched).toBe(true);
20
- expect(check('section-foo billing name').matched).toBe(true);
21
- expect(check('section-foo billing home').matched).toBe(true);
22
- expect(check('section-foo billing work').matched).toBe(true);
23
- expect(check('section-foo billing home tel').matched).toBe(true);
24
- expect(check('section-foo billing work email').matched).toBe(true);
25
- expect(check('section-foo billing work email webauthn').matched).toBe(true);
26
- expect(check('shipping name').matched).toBe(true);
27
- expect(check('billing name').matched).toBe(true);
28
- expect(check('billing home').matched).toBe(true);
29
- expect(check('billing work').matched).toBe(true);
30
- expect(check('billing home tel').matched).toBe(true);
31
- expect(check('billing work email').matched).toBe(true);
32
- expect(check('billing work email webauthn').matched).toBe(true);
33
- expect(check('home tel').matched).toBe(true);
34
- expect(check('work email').matched).toBe(true);
35
- expect(check('work email webauthn').matched).toBe(true);
36
- });
37
- test('unexpected-token', () => {
38
- expect(check('section-foo , name')).toStrictEqual({
39
- matched: false,
40
- raw: ',',
41
- offset: 12,
42
- length: 1,
43
- line: 1,
44
- column: 13,
45
- reason: 'unexpected-token',
46
- expects: [
47
- { type: 'const', value: 'billing' },
48
- { type: 'const', value: 'shipping' },
49
- { type: 'common', value: 'autofill field name' },
50
- ],
51
- candidate: undefined,
52
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
53
- });
54
- });
55
- test('unexpected-token', () => {
56
- expect(check('xxx')).toStrictEqual({
57
- matched: false,
58
- raw: 'xxx',
59
- offset: 0,
60
- length: 3,
61
- line: 1,
62
- column: 1,
63
- reason: 'unexpected-token',
64
- expects: [
65
- { type: 'common', value: 'autofill named group' },
66
- { type: 'common', value: 'autofill field name' },
67
- ],
68
- candidate: undefined,
69
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
70
- });
71
- });
72
- test('unexpected-token', () => {
73
- expect(check('section-foo neme')).toStrictEqual({
74
- matched: false,
75
- raw: 'neme',
76
- offset: 12,
77
- length: 4,
78
- line: 1,
79
- column: 13,
80
- reason: 'unexpected-token',
81
- expects: [
82
- { type: 'const', value: 'billing' },
83
- { type: 'const', value: 'shipping' },
84
- { type: 'common', value: 'autofill field name' },
85
- ],
86
- candidate: 'name',
87
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
88
- });
89
- expect(check('section-foo shipping neme')).toStrictEqual({
90
- matched: false,
91
- raw: 'neme',
92
- offset: 21,
93
- length: 4,
94
- line: 1,
95
- column: 22,
96
- reason: 'unexpected-token',
97
- expects: [
98
- { type: 'common', value: 'autofill field name' },
99
- { type: 'const', value: 'home' },
100
- { type: 'const', value: 'work' },
101
- { type: 'const', value: 'mobile' },
102
- { type: 'const', value: 'fax' },
103
- { type: 'const', value: 'pager' },
104
- ],
105
- candidate: 'name',
106
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
107
- });
108
- expect(check('section-foo shipping home name')).toStrictEqual({
109
- matched: false,
110
- raw: 'name',
111
- offset: 26,
112
- length: 4,
113
- line: 1,
114
- column: 27,
115
- reason: 'unexpected-token',
116
- expects: [
117
- { type: 'const', value: 'tel' },
118
- { type: 'const', value: 'tel-country-code' },
119
- { type: 'const', value: 'tel-national' },
120
- { type: 'const', value: 'tel-area-code' },
121
- { type: 'const', value: 'tel-local' },
122
- { type: 'const', value: 'tel-local-prefix' },
123
- { type: 'const', value: 'tel-local-suffix' },
124
- { type: 'const', value: 'tel-extension' },
125
- { type: 'const', value: 'email' },
126
- { type: 'const', value: 'impp' },
127
- ],
128
- candidate: undefined,
129
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-tel',
130
- });
131
- expect(check('section-foo shipping home emall')).toStrictEqual({
132
- matched: false,
133
- raw: 'emall',
134
- offset: 26,
135
- length: 5,
136
- line: 1,
137
- column: 27,
138
- reason: 'unexpected-token',
139
- expects: [
140
- { type: 'const', value: 'tel' },
141
- { type: 'const', value: 'tel-country-code' },
142
- { type: 'const', value: 'tel-national' },
143
- { type: 'const', value: 'tel-area-code' },
144
- { type: 'const', value: 'tel-local' },
145
- { type: 'const', value: 'tel-local-prefix' },
146
- { type: 'const', value: 'tel-local-suffix' },
147
- { type: 'const', value: 'tel-extension' },
148
- { type: 'const', value: 'email' },
149
- { type: 'const', value: 'impp' },
150
- ],
151
- candidate: 'email',
152
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-tel',
153
- });
154
- });
155
- test('duplicated', () => {
156
- expect(check('name name')).toStrictEqual({
157
- matched: false,
158
- raw: 'name',
159
- offset: 5,
160
- length: 4,
161
- line: 1,
162
- column: 6,
163
- partName: 'the content of the list',
164
- reason: 'duplicated',
165
- expects: [{ type: 'format', value: 'autocomplete' }],
166
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete',
167
- });
168
- expect(check('on on')).toStrictEqual({
169
- matched: false,
170
- raw: 'on',
171
- offset: 3,
172
- length: 2,
173
- line: 1,
174
- column: 4,
175
- partName: 'the content of the list',
176
- reason: 'duplicated',
177
- expects: [{ type: 'format', value: 'autocomplete' }],
178
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete',
179
- });
180
- });
181
- test('extra-token', () => {
182
- expect(check('on off')).toStrictEqual({
183
- matched: false,
184
- raw: 'off',
185
- offset: 3,
186
- length: 3,
187
- line: 1,
188
- column: 4,
189
- reason: 'extra-token',
190
- expects: [{ type: 'format', value: 'autocomplete' }],
191
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
192
- });
193
- expect(check('off on')).toStrictEqual({
194
- matched: false,
195
- raw: 'on',
196
- offset: 4,
197
- length: 2,
198
- line: 1,
199
- column: 5,
200
- reason: 'extra-token',
201
- expects: [{ type: 'format', value: 'autocomplete' }],
202
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
203
- });
204
- expect(check('on name')).toStrictEqual({
205
- matched: false,
206
- raw: 'name',
207
- offset: 3,
208
- length: 4,
209
- line: 1,
210
- column: 4,
211
- reason: 'extra-token',
212
- expects: [{ type: 'format', value: 'autocomplete' }],
213
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-on-2',
214
- });
215
- expect(check('name on')).toStrictEqual({
216
- matched: false,
217
- raw: 'on',
218
- offset: 5,
219
- length: 2,
220
- line: 1,
221
- column: 6,
222
- reason: 'extra-token',
223
- expects: [{ type: 'format', value: 'autocomplete' }],
224
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
225
- });
226
- expect(check('section-foo name on')).toStrictEqual({
227
- matched: false,
228
- raw: 'on',
229
- offset: 17,
230
- length: 2,
231
- line: 1,
232
- column: 18,
233
- reason: 'extra-token',
234
- expects: [{ type: 'format', value: 'autocomplete' }],
235
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
236
- });
237
- expect(check('section-foo billing name on')).toStrictEqual({
238
- matched: false,
239
- raw: 'on',
240
- offset: 25,
241
- length: 2,
242
- line: 1,
243
- column: 26,
244
- reason: 'extra-token',
245
- expects: [{ type: 'format', value: 'autocomplete' }],
246
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
247
- });
248
- expect(check('billing name on')).toStrictEqual({
249
- matched: false,
250
- raw: 'on',
251
- offset: 13,
252
- length: 2,
253
- line: 1,
254
- column: 14,
255
- reason: 'extra-token',
256
- expects: [{ type: 'format', value: 'autocomplete' }],
257
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
258
- });
259
- expect(check('tel on')).toStrictEqual({
260
- matched: false,
261
- raw: 'on',
262
- offset: 4,
263
- length: 2,
264
- line: 1,
265
- column: 5,
266
- reason: 'extra-token',
267
- expects: [{ type: 'format', value: 'autocomplete' }],
268
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
269
- });
270
- expect(check('home tel on')).toStrictEqual({
271
- matched: false,
272
- raw: 'on',
273
- offset: 9,
274
- length: 2,
275
- line: 1,
276
- column: 10,
277
- reason: 'extra-token',
278
- expects: [{ type: 'format', value: 'autocomplete' }],
279
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
280
- });
281
- expect(check('billing home tel on')).toStrictEqual({
282
- matched: false,
283
- raw: 'on',
284
- offset: 17,
285
- length: 2,
286
- line: 1,
287
- column: 18,
288
- reason: 'extra-token',
289
- expects: [{ type: 'format', value: 'autocomplete' }],
290
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
291
- });
292
- expect(check('billing home tel on')).toStrictEqual({
293
- matched: false,
294
- raw: 'on',
295
- offset: 17,
296
- length: 2,
297
- line: 1,
298
- column: 18,
299
- reason: 'extra-token',
300
- expects: [{ type: 'format', value: 'autocomplete' }],
301
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
302
- });
303
- expect(check('section-foo billing home tel on')).toStrictEqual({
304
- matched: false,
305
- raw: 'on',
306
- offset: 29,
307
- length: 2,
308
- line: 1,
309
- column: 30,
310
- reason: 'extra-token',
311
- expects: [{ type: 'format', value: 'autocomplete' }],
312
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
313
- });
314
- expect(check('section-foo home tel on')).toStrictEqual({
315
- matched: false,
316
- raw: 'on',
317
- offset: 21,
318
- length: 2,
319
- line: 1,
320
- column: 22,
321
- reason: 'extra-token',
322
- expects: [{ type: 'format', value: 'autocomplete' }],
323
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
324
- });
325
- expect(check('section-foo tel on')).toStrictEqual({
326
- matched: false,
327
- raw: 'on',
328
- offset: 16,
329
- length: 2,
330
- line: 1,
331
- column: 17,
332
- reason: 'extra-token',
333
- expects: [{ type: 'format', value: 'autocomplete' }],
334
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
335
- });
336
- });
337
- test('duplicated section', () => {
338
- expect(check('section-foo section-bar')).toStrictEqual({
339
- matched: false,
340
- raw: 'section-bar',
341
- offset: 12,
342
- length: 11,
343
- line: 1,
344
- column: 13,
345
- partName: 'autofill named group',
346
- reason: 'duplicated',
347
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-section',
348
- });
349
- });
350
- test('duplicated part', () => {
351
- expect(check('shipping billing')).toStrictEqual({
352
- matched: false,
353
- raw: 'billing',
354
- offset: 9,
355
- length: 7,
356
- line: 1,
357
- column: 10,
358
- reason: 'duplicated',
359
- expects: [{ type: 'format', value: 'autocomplete' }],
360
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete-shipping',
361
- });
362
- });
363
- test('typo', () => {
364
- expect(check('secsion-foo name')).toStrictEqual({
365
- matched: false,
366
- raw: 'secsion-foo',
367
- offset: 0,
368
- length: 11,
369
- line: 1,
370
- column: 1,
371
- reason: 'unexpected-token',
372
- expects: [
373
- { type: 'common', value: 'autofill named group' },
374
- { type: 'common', value: 'autofill field name' },
375
- ],
376
- candidate: 'section-foo',
377
- ref: 'https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field',
378
- });
379
- });
@@ -1 +0,0 @@
1
- export {};