@alexlit/lint-kit 117.3.1 → 117.5.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.
Files changed (160) hide show
  1. package/package.json +1 -1
  2. package/packages/config-eslint/package.json +7 -11
  3. package/packages/config-eslint/plugins/no-await-in-promise.js +1 -1
  4. package/packages/config-eslint/utils/create-config.js +3 -3
  5. package/packages/config-hooks/package.json +2 -2
  6. package/scripts/.config.sh +1 -1
  7. package/packages/config-eslint/node_modules/@eslint/eslintrc/LICENSE +0 -19
  8. package/packages/config-eslint/node_modules/@eslint/eslintrc/README.md +0 -126
  9. package/packages/config-eslint/node_modules/@eslint/eslintrc/conf/config-schema.js +0 -79
  10. package/packages/config-eslint/node_modules/@eslint/eslintrc/conf/environments.js +0 -215
  11. package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +0 -1143
  12. package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +0 -1
  13. package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -4371
  14. package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +0 -1
  15. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js +0 -532
  16. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +0 -510
  17. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js +0 -124
  18. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js +0 -145
  19. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js +0 -238
  20. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/index.js +0 -19
  21. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js +0 -225
  22. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js +0 -1155
  23. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js +0 -318
  24. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/index-universal.js +0 -29
  25. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/index.js +0 -58
  26. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/ajv.js +0 -191
  27. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/config-ops.js +0 -135
  28. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +0 -370
  29. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js +0 -63
  30. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/naming.js +0 -96
  31. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js +0 -42
  32. package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/types.js +0 -149
  33. package/packages/config-eslint/node_modules/@eslint/eslintrc/package.json +0 -82
  34. package/packages/config-eslint/node_modules/@eslint/eslintrc/universal.js +0 -9
  35. package/packages/config-eslint/node_modules/ajv/.tonic_example.js +0 -20
  36. package/packages/config-eslint/node_modules/ajv/LICENSE +0 -22
  37. package/packages/config-eslint/node_modules/ajv/README.md +0 -1497
  38. package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +0 -7189
  39. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +0 -3
  40. package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +0 -1
  41. package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +0 -397
  42. package/packages/config-eslint/node_modules/ajv/lib/ajv.js +0 -506
  43. package/packages/config-eslint/node_modules/ajv/lib/cache.js +0 -26
  44. package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +0 -90
  45. package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +0 -5
  46. package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +0 -34
  47. package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +0 -142
  48. package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +0 -387
  49. package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +0 -270
  50. package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +0 -66
  51. package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +0 -9
  52. package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +0 -20
  53. package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +0 -239
  54. package/packages/config-eslint/node_modules/ajv/lib/data.js +0 -49
  55. package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +0 -37
  56. package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +0 -113
  57. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +0 -12
  58. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +0 -12
  59. package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +0 -12
  60. package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +0 -32
  61. package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +0 -46
  62. package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +0 -51
  63. package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +0 -9
  64. package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +0 -11
  65. package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +0 -55
  66. package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +0 -191
  67. package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +0 -47
  68. package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +0 -203
  69. package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +0 -79
  70. package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +0 -30
  71. package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +0 -194
  72. package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +0 -106
  73. package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +0 -73
  74. package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +0 -98
  75. package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +0 -39
  76. package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +0 -22
  77. package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +0 -43
  78. package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +0 -54
  79. package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +0 -14
  80. package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +0 -245
  81. package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +0 -52
  82. package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +0 -85
  83. package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +0 -108
  84. package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +0 -62
  85. package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +0 -276
  86. package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +0 -3
  87. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +0 -163
  88. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +0 -80
  89. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +0 -85
  90. package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -80
  91. package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +0 -42
  92. package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +0 -73
  93. package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +0 -14
  94. package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +0 -56
  95. package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +0 -81
  96. package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +0 -228
  97. package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +0 -168
  98. package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +0 -66
  99. package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +0 -150
  100. package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +0 -103
  101. package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +0 -33
  102. package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +0 -140
  103. package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +0 -80
  104. package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +0 -84
  105. package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +0 -73
  106. package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +0 -75
  107. package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +0 -335
  108. package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +0 -81
  109. package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +0 -124
  110. package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +0 -270
  111. package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -86
  112. package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +0 -482
  113. package/packages/config-eslint/node_modules/ajv/lib/keyword.js +0 -146
  114. package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +0 -17
  115. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +0 -149
  116. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -154
  117. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -168
  118. package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +0 -94
  119. package/packages/config-eslint/node_modules/ajv/package.json +0 -106
  120. package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +0 -3
  121. package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +0 -61
  122. package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +0 -73
  123. package/packages/config-eslint/node_modules/ajv/scripts/info +0 -10
  124. package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +0 -12
  125. package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +0 -32
  126. package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +0 -23
  127. package/packages/config-eslint/node_modules/eslint-visitor-keys/LICENSE +0 -201
  128. package/packages/config-eslint/node_modules/eslint-visitor-keys/README.md +0 -105
  129. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +0 -384
  130. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +0 -27
  131. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/index.d.ts +0 -16
  132. package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +0 -12
  133. package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/index.js +0 -65
  134. package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.js +0 -315
  135. package/packages/config-eslint/node_modules/eslint-visitor-keys/package.json +0 -74
  136. package/packages/config-eslint/node_modules/espree/LICENSE +0 -25
  137. package/packages/config-eslint/node_modules/espree/README.md +0 -244
  138. package/packages/config-eslint/node_modules/espree/dist/espree.cjs +0 -883
  139. package/packages/config-eslint/node_modules/espree/espree.js +0 -177
  140. package/packages/config-eslint/node_modules/espree/lib/espree.js +0 -349
  141. package/packages/config-eslint/node_modules/espree/lib/features.js +0 -27
  142. package/packages/config-eslint/node_modules/espree/lib/options.js +0 -123
  143. package/packages/config-eslint/node_modules/espree/lib/token-translator.js +0 -263
  144. package/packages/config-eslint/node_modules/espree/lib/version.js +0 -3
  145. package/packages/config-eslint/node_modules/espree/package.json +0 -86
  146. package/packages/config-eslint/node_modules/globals/globals.json +0 -1998
  147. package/packages/config-eslint/node_modules/globals/index.d.ts +0 -2077
  148. package/packages/config-eslint/node_modules/globals/index.js +0 -2
  149. package/packages/config-eslint/node_modules/globals/license +0 -9
  150. package/packages/config-eslint/node_modules/globals/package.json +0 -58
  151. package/packages/config-eslint/node_modules/globals/readme.md +0 -44
  152. package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +0 -27
  153. package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +0 -8
  154. package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +0 -21
  155. package/packages/config-eslint/node_modules/json-schema-traverse/README.md +0 -83
  156. package/packages/config-eslint/node_modules/json-schema-traverse/index.js +0 -89
  157. package/packages/config-eslint/node_modules/json-schema-traverse/package.json +0 -43
  158. package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +0 -6
  159. package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +0 -125
  160. package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +0 -171
@@ -1,384 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- /**
6
- * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
7
- */
8
-
9
- /**
10
- * @type {VisitorKeys}
11
- */
12
- const KEYS = {
13
- ArrayExpression: [
14
- "elements"
15
- ],
16
- ArrayPattern: [
17
- "elements"
18
- ],
19
- ArrowFunctionExpression: [
20
- "params",
21
- "body"
22
- ],
23
- AssignmentExpression: [
24
- "left",
25
- "right"
26
- ],
27
- AssignmentPattern: [
28
- "left",
29
- "right"
30
- ],
31
- AwaitExpression: [
32
- "argument"
33
- ],
34
- BinaryExpression: [
35
- "left",
36
- "right"
37
- ],
38
- BlockStatement: [
39
- "body"
40
- ],
41
- BreakStatement: [
42
- "label"
43
- ],
44
- CallExpression: [
45
- "callee",
46
- "arguments"
47
- ],
48
- CatchClause: [
49
- "param",
50
- "body"
51
- ],
52
- ChainExpression: [
53
- "expression"
54
- ],
55
- ClassBody: [
56
- "body"
57
- ],
58
- ClassDeclaration: [
59
- "id",
60
- "superClass",
61
- "body"
62
- ],
63
- ClassExpression: [
64
- "id",
65
- "superClass",
66
- "body"
67
- ],
68
- ConditionalExpression: [
69
- "test",
70
- "consequent",
71
- "alternate"
72
- ],
73
- ContinueStatement: [
74
- "label"
75
- ],
76
- DebuggerStatement: [],
77
- DoWhileStatement: [
78
- "body",
79
- "test"
80
- ],
81
- EmptyStatement: [],
82
- ExperimentalRestProperty: [
83
- "argument"
84
- ],
85
- ExperimentalSpreadProperty: [
86
- "argument"
87
- ],
88
- ExportAllDeclaration: [
89
- "exported",
90
- "source"
91
- ],
92
- ExportDefaultDeclaration: [
93
- "declaration"
94
- ],
95
- ExportNamedDeclaration: [
96
- "declaration",
97
- "specifiers",
98
- "source"
99
- ],
100
- ExportSpecifier: [
101
- "exported",
102
- "local"
103
- ],
104
- ExpressionStatement: [
105
- "expression"
106
- ],
107
- ForInStatement: [
108
- "left",
109
- "right",
110
- "body"
111
- ],
112
- ForOfStatement: [
113
- "left",
114
- "right",
115
- "body"
116
- ],
117
- ForStatement: [
118
- "init",
119
- "test",
120
- "update",
121
- "body"
122
- ],
123
- FunctionDeclaration: [
124
- "id",
125
- "params",
126
- "body"
127
- ],
128
- FunctionExpression: [
129
- "id",
130
- "params",
131
- "body"
132
- ],
133
- Identifier: [],
134
- IfStatement: [
135
- "test",
136
- "consequent",
137
- "alternate"
138
- ],
139
- ImportDeclaration: [
140
- "specifiers",
141
- "source"
142
- ],
143
- ImportDefaultSpecifier: [
144
- "local"
145
- ],
146
- ImportExpression: [
147
- "source"
148
- ],
149
- ImportNamespaceSpecifier: [
150
- "local"
151
- ],
152
- ImportSpecifier: [
153
- "imported",
154
- "local"
155
- ],
156
- JSXAttribute: [
157
- "name",
158
- "value"
159
- ],
160
- JSXClosingElement: [
161
- "name"
162
- ],
163
- JSXClosingFragment: [],
164
- JSXElement: [
165
- "openingElement",
166
- "children",
167
- "closingElement"
168
- ],
169
- JSXEmptyExpression: [],
170
- JSXExpressionContainer: [
171
- "expression"
172
- ],
173
- JSXFragment: [
174
- "openingFragment",
175
- "children",
176
- "closingFragment"
177
- ],
178
- JSXIdentifier: [],
179
- JSXMemberExpression: [
180
- "object",
181
- "property"
182
- ],
183
- JSXNamespacedName: [
184
- "namespace",
185
- "name"
186
- ],
187
- JSXOpeningElement: [
188
- "name",
189
- "attributes"
190
- ],
191
- JSXOpeningFragment: [],
192
- JSXSpreadAttribute: [
193
- "argument"
194
- ],
195
- JSXSpreadChild: [
196
- "expression"
197
- ],
198
- JSXText: [],
199
- LabeledStatement: [
200
- "label",
201
- "body"
202
- ],
203
- Literal: [],
204
- LogicalExpression: [
205
- "left",
206
- "right"
207
- ],
208
- MemberExpression: [
209
- "object",
210
- "property"
211
- ],
212
- MetaProperty: [
213
- "meta",
214
- "property"
215
- ],
216
- MethodDefinition: [
217
- "key",
218
- "value"
219
- ],
220
- NewExpression: [
221
- "callee",
222
- "arguments"
223
- ],
224
- ObjectExpression: [
225
- "properties"
226
- ],
227
- ObjectPattern: [
228
- "properties"
229
- ],
230
- PrivateIdentifier: [],
231
- Program: [
232
- "body"
233
- ],
234
- Property: [
235
- "key",
236
- "value"
237
- ],
238
- PropertyDefinition: [
239
- "key",
240
- "value"
241
- ],
242
- RestElement: [
243
- "argument"
244
- ],
245
- ReturnStatement: [
246
- "argument"
247
- ],
248
- SequenceExpression: [
249
- "expressions"
250
- ],
251
- SpreadElement: [
252
- "argument"
253
- ],
254
- StaticBlock: [
255
- "body"
256
- ],
257
- Super: [],
258
- SwitchCase: [
259
- "test",
260
- "consequent"
261
- ],
262
- SwitchStatement: [
263
- "discriminant",
264
- "cases"
265
- ],
266
- TaggedTemplateExpression: [
267
- "tag",
268
- "quasi"
269
- ],
270
- TemplateElement: [],
271
- TemplateLiteral: [
272
- "quasis",
273
- "expressions"
274
- ],
275
- ThisExpression: [],
276
- ThrowStatement: [
277
- "argument"
278
- ],
279
- TryStatement: [
280
- "block",
281
- "handler",
282
- "finalizer"
283
- ],
284
- UnaryExpression: [
285
- "argument"
286
- ],
287
- UpdateExpression: [
288
- "argument"
289
- ],
290
- VariableDeclaration: [
291
- "declarations"
292
- ],
293
- VariableDeclarator: [
294
- "id",
295
- "init"
296
- ],
297
- WhileStatement: [
298
- "test",
299
- "body"
300
- ],
301
- WithStatement: [
302
- "object",
303
- "body"
304
- ],
305
- YieldExpression: [
306
- "argument"
307
- ]
308
- };
309
-
310
- // Types.
311
- const NODE_TYPES = Object.keys(KEYS);
312
-
313
- // Freeze the keys.
314
- for (const type of NODE_TYPES) {
315
- Object.freeze(KEYS[type]);
316
- }
317
- Object.freeze(KEYS);
318
-
319
- /**
320
- * @author Toru Nagashima <https://github.com/mysticatea>
321
- * See LICENSE file in root directory for full license.
322
- */
323
-
324
- /**
325
- * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
326
- */
327
-
328
- // List to ignore keys.
329
- const KEY_BLACKLIST = new Set([
330
- "parent",
331
- "leadingComments",
332
- "trailingComments"
333
- ]);
334
-
335
- /**
336
- * Check whether a given key should be used or not.
337
- * @param {string} key The key to check.
338
- * @returns {boolean} `true` if the key should be used.
339
- */
340
- function filterKey(key) {
341
- return !KEY_BLACKLIST.has(key) && key[0] !== "_";
342
- }
343
-
344
- /**
345
- * Get visitor keys of a given node.
346
- * @param {object} node The AST node to get keys.
347
- * @returns {readonly string[]} Visitor keys of the node.
348
- */
349
- function getKeys(node) {
350
- return Object.keys(node).filter(filterKey);
351
- }
352
-
353
- // Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
354
- // eslint-disable-next-line valid-jsdoc
355
- /**
356
- * Make the union set with `KEYS` and given keys.
357
- * @param {VisitorKeys} additionalKeys The additional keys.
358
- * @returns {VisitorKeys} The union set.
359
- */
360
- function unionWith(additionalKeys) {
361
- const retv = /** @type {{
362
- [type: string]: ReadonlyArray<string>
363
- }} */ (Object.assign({}, KEYS));
364
-
365
- for (const type of Object.keys(additionalKeys)) {
366
- if (Object.prototype.hasOwnProperty.call(retv, type)) {
367
- const keys = new Set(additionalKeys[type]);
368
-
369
- for (const key of retv[type]) {
370
- keys.add(key);
371
- }
372
-
373
- retv[type] = Object.freeze(Array.from(keys));
374
- } else {
375
- retv[type] = Object.freeze(Array.from(additionalKeys[type]));
376
- }
377
- }
378
-
379
- return Object.freeze(retv);
380
- }
381
-
382
- exports.KEYS = KEYS;
383
- exports.getKeys = getKeys;
384
- exports.unionWith = unionWith;
@@ -1,27 +0,0 @@
1
- type VisitorKeys$1 = {
2
- readonly [type: string]: readonly string[];
3
- };
4
- /**
5
- * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
6
- */
7
- /**
8
- * @type {VisitorKeys}
9
- */
10
- declare const KEYS: VisitorKeys$1;
11
-
12
- /**
13
- * Get visitor keys of a given node.
14
- * @param {object} node The AST node to get keys.
15
- * @returns {readonly string[]} Visitor keys of the node.
16
- */
17
- declare function getKeys(node: object): readonly string[];
18
- /**
19
- * Make the union set with `KEYS` and given keys.
20
- * @param {VisitorKeys} additionalKeys The additional keys.
21
- * @returns {VisitorKeys} The union set.
22
- */
23
- declare function unionWith(additionalKeys: VisitorKeys): VisitorKeys;
24
-
25
- type VisitorKeys = VisitorKeys$1;
26
-
27
- export { KEYS, VisitorKeys, getKeys, unionWith };
@@ -1,16 +0,0 @@
1
- /**
2
- * Get visitor keys of a given node.
3
- * @param {object} node The AST node to get keys.
4
- * @returns {readonly string[]} Visitor keys of the node.
5
- */
6
- export function getKeys(node: object): readonly string[];
7
- /**
8
- * Make the union set with `KEYS` and given keys.
9
- * @param {VisitorKeys} additionalKeys The additional keys.
10
- * @returns {VisitorKeys} The union set.
11
- */
12
- export function unionWith(additionalKeys: VisitorKeys): VisitorKeys;
13
- export { KEYS };
14
- export type VisitorKeys = import('./visitor-keys.js').VisitorKeys;
15
- import KEYS from "./visitor-keys.js";
16
- //# sourceMappingURL=index.d.ts.map
@@ -1,12 +0,0 @@
1
- export default KEYS;
2
- export type VisitorKeys = {
3
- readonly [type: string]: readonly string[];
4
- };
5
- /**
6
- * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
7
- */
8
- /**
9
- * @type {VisitorKeys}
10
- */
11
- declare const KEYS: VisitorKeys;
12
- //# sourceMappingURL=visitor-keys.d.ts.map
@@ -1,65 +0,0 @@
1
- /**
2
- * @author Toru Nagashima <https://github.com/mysticatea>
3
- * See LICENSE file in root directory for full license.
4
- */
5
- import KEYS from "./visitor-keys.js";
6
-
7
- /**
8
- * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
9
- */
10
-
11
- // List to ignore keys.
12
- const KEY_BLACKLIST = new Set([
13
- "parent",
14
- "leadingComments",
15
- "trailingComments"
16
- ]);
17
-
18
- /**
19
- * Check whether a given key should be used or not.
20
- * @param {string} key The key to check.
21
- * @returns {boolean} `true` if the key should be used.
22
- */
23
- function filterKey(key) {
24
- return !KEY_BLACKLIST.has(key) && key[0] !== "_";
25
- }
26
-
27
- /**
28
- * Get visitor keys of a given node.
29
- * @param {object} node The AST node to get keys.
30
- * @returns {readonly string[]} Visitor keys of the node.
31
- */
32
- export function getKeys(node) {
33
- return Object.keys(node).filter(filterKey);
34
- }
35
-
36
- // Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
37
- // eslint-disable-next-line valid-jsdoc
38
- /**
39
- * Make the union set with `KEYS` and given keys.
40
- * @param {VisitorKeys} additionalKeys The additional keys.
41
- * @returns {VisitorKeys} The union set.
42
- */
43
- export function unionWith(additionalKeys) {
44
- const retv = /** @type {{
45
- [type: string]: ReadonlyArray<string>
46
- }} */ (Object.assign({}, KEYS));
47
-
48
- for (const type of Object.keys(additionalKeys)) {
49
- if (Object.prototype.hasOwnProperty.call(retv, type)) {
50
- const keys = new Set(additionalKeys[type]);
51
-
52
- for (const key of retv[type]) {
53
- keys.add(key);
54
- }
55
-
56
- retv[type] = Object.freeze(Array.from(keys));
57
- } else {
58
- retv[type] = Object.freeze(Array.from(additionalKeys[type]));
59
- }
60
- }
61
-
62
- return Object.freeze(retv);
63
- }
64
-
65
- export { KEYS };