@dcf-micro/eslint-config 5.0.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 (46) hide show
  1. package/dist/chunks/eslint-plugin-prettier.mjs +1716 -0
  2. package/dist/chunks/index.mjs +1341 -0
  3. package/dist/chunks/index10.mjs +39595 -0
  4. package/dist/chunks/index11.mjs +24 -0
  5. package/dist/chunks/index12.mjs +75273 -0
  6. package/dist/chunks/index13.mjs +55129 -0
  7. package/dist/chunks/index14.mjs +24 -0
  8. package/dist/chunks/index15.mjs +1441 -0
  9. package/dist/chunks/index2.mjs +31864 -0
  10. package/dist/chunks/index3.mjs +8154 -0
  11. package/dist/chunks/index4.mjs +24 -0
  12. package/dist/chunks/index5.mjs +44093 -0
  13. package/dist/chunks/index6.mjs +10371 -0
  14. package/dist/chunks/index7.mjs +21890 -0
  15. package/dist/chunks/index8.mjs +14424 -0
  16. package/dist/chunks/index9.mjs +194 -0
  17. package/dist/chunks/jiti.mjs +320 -0
  18. package/dist/index.d.mts +3897 -0
  19. package/dist/index.d.ts +3897 -0
  20. package/dist/index.mjs +4 -0
  21. package/dist/shared/eslint-config.BDBLGvXj.mjs +5282 -0
  22. package/dist/shared/eslint-config.BEdqg1el.mjs +12256 -0
  23. package/dist/shared/eslint-config.BKmXKm8B.mjs +5533 -0
  24. package/dist/shared/eslint-config.BjUMgISS.mjs +9012 -0
  25. package/dist/shared/eslint-config.Bk-3rH6Y.mjs +1355 -0
  26. package/dist/shared/eslint-config.BytuZ0Ec.mjs +20 -0
  27. package/dist/shared/eslint-config.C1V0I4Np.mjs +16900 -0
  28. package/dist/shared/eslint-config.CGxZQKHV.mjs +2091 -0
  29. package/dist/shared/eslint-config.COweQ1RR.mjs +5 -0
  30. package/dist/shared/eslint-config.CSnk9Q4w.mjs +9339 -0
  31. package/dist/shared/eslint-config.CWvTq0mr.mjs +2914 -0
  32. package/dist/shared/eslint-config.Ca4PTK8E.mjs +646 -0
  33. package/dist/shared/eslint-config.CmPTszkJ.mjs +3583 -0
  34. package/dist/shared/eslint-config.CqEANaNA.mjs +139622 -0
  35. package/dist/shared/eslint-config.CsePEcYJ.mjs +71 -0
  36. package/dist/shared/eslint-config.Cw6mETSZ.mjs +2580 -0
  37. package/dist/shared/eslint-config.DTVnsecK.mjs +1751 -0
  38. package/dist/shared/eslint-config.DWoU09EE.mjs +6958 -0
  39. package/dist/shared/eslint-config.DZvqTQUU.mjs +3818 -0
  40. package/dist/shared/eslint-config.Dhg7lT0g.mjs +1807 -0
  41. package/dist/shared/eslint-config.Du5y5qmf.mjs +200673 -0
  42. package/dist/shared/eslint-config.FKVuBSa4.mjs +394 -0
  43. package/dist/shared/eslint-config.I8d-HnmI.mjs +2654 -0
  44. package/dist/shared/eslint-config.YntqsQY1.mjs +40 -0
  45. package/dist/shared/eslint-config.uGTBNMD0.mjs +687 -0
  46. package/package.json +56 -0
@@ -0,0 +1,394 @@
1
+ var eslintVisitorKeys = {};
2
+
3
+ var hasRequiredEslintVisitorKeys;
4
+
5
+ function requireEslintVisitorKeys () {
6
+ if (hasRequiredEslintVisitorKeys) return eslintVisitorKeys;
7
+ hasRequiredEslintVisitorKeys = 1;
8
+
9
+ Object.defineProperty(eslintVisitorKeys, '__esModule', { value: true });
10
+
11
+ /**
12
+ * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
13
+ */
14
+
15
+ /**
16
+ * @type {VisitorKeys}
17
+ */
18
+ const KEYS = {
19
+ ArrayExpression: [
20
+ "elements"
21
+ ],
22
+ ArrayPattern: [
23
+ "elements"
24
+ ],
25
+ ArrowFunctionExpression: [
26
+ "params",
27
+ "body"
28
+ ],
29
+ AssignmentExpression: [
30
+ "left",
31
+ "right"
32
+ ],
33
+ AssignmentPattern: [
34
+ "left",
35
+ "right"
36
+ ],
37
+ AwaitExpression: [
38
+ "argument"
39
+ ],
40
+ BinaryExpression: [
41
+ "left",
42
+ "right"
43
+ ],
44
+ BlockStatement: [
45
+ "body"
46
+ ],
47
+ BreakStatement: [
48
+ "label"
49
+ ],
50
+ CallExpression: [
51
+ "callee",
52
+ "arguments"
53
+ ],
54
+ CatchClause: [
55
+ "param",
56
+ "body"
57
+ ],
58
+ ChainExpression: [
59
+ "expression"
60
+ ],
61
+ ClassBody: [
62
+ "body"
63
+ ],
64
+ ClassDeclaration: [
65
+ "id",
66
+ "superClass",
67
+ "body"
68
+ ],
69
+ ClassExpression: [
70
+ "id",
71
+ "superClass",
72
+ "body"
73
+ ],
74
+ ConditionalExpression: [
75
+ "test",
76
+ "consequent",
77
+ "alternate"
78
+ ],
79
+ ContinueStatement: [
80
+ "label"
81
+ ],
82
+ DebuggerStatement: [],
83
+ DoWhileStatement: [
84
+ "body",
85
+ "test"
86
+ ],
87
+ EmptyStatement: [],
88
+ ExperimentalRestProperty: [
89
+ "argument"
90
+ ],
91
+ ExperimentalSpreadProperty: [
92
+ "argument"
93
+ ],
94
+ ExportAllDeclaration: [
95
+ "exported",
96
+ "source"
97
+ ],
98
+ ExportDefaultDeclaration: [
99
+ "declaration"
100
+ ],
101
+ ExportNamedDeclaration: [
102
+ "declaration",
103
+ "specifiers",
104
+ "source"
105
+ ],
106
+ ExportSpecifier: [
107
+ "exported",
108
+ "local"
109
+ ],
110
+ ExpressionStatement: [
111
+ "expression"
112
+ ],
113
+ ForInStatement: [
114
+ "left",
115
+ "right",
116
+ "body"
117
+ ],
118
+ ForOfStatement: [
119
+ "left",
120
+ "right",
121
+ "body"
122
+ ],
123
+ ForStatement: [
124
+ "init",
125
+ "test",
126
+ "update",
127
+ "body"
128
+ ],
129
+ FunctionDeclaration: [
130
+ "id",
131
+ "params",
132
+ "body"
133
+ ],
134
+ FunctionExpression: [
135
+ "id",
136
+ "params",
137
+ "body"
138
+ ],
139
+ Identifier: [],
140
+ IfStatement: [
141
+ "test",
142
+ "consequent",
143
+ "alternate"
144
+ ],
145
+ ImportDeclaration: [
146
+ "specifiers",
147
+ "source"
148
+ ],
149
+ ImportDefaultSpecifier: [
150
+ "local"
151
+ ],
152
+ ImportExpression: [
153
+ "source"
154
+ ],
155
+ ImportNamespaceSpecifier: [
156
+ "local"
157
+ ],
158
+ ImportSpecifier: [
159
+ "imported",
160
+ "local"
161
+ ],
162
+ JSXAttribute: [
163
+ "name",
164
+ "value"
165
+ ],
166
+ JSXClosingElement: [
167
+ "name"
168
+ ],
169
+ JSXClosingFragment: [],
170
+ JSXElement: [
171
+ "openingElement",
172
+ "children",
173
+ "closingElement"
174
+ ],
175
+ JSXEmptyExpression: [],
176
+ JSXExpressionContainer: [
177
+ "expression"
178
+ ],
179
+ JSXFragment: [
180
+ "openingFragment",
181
+ "children",
182
+ "closingFragment"
183
+ ],
184
+ JSXIdentifier: [],
185
+ JSXMemberExpression: [
186
+ "object",
187
+ "property"
188
+ ],
189
+ JSXNamespacedName: [
190
+ "namespace",
191
+ "name"
192
+ ],
193
+ JSXOpeningElement: [
194
+ "name",
195
+ "attributes"
196
+ ],
197
+ JSXOpeningFragment: [],
198
+ JSXSpreadAttribute: [
199
+ "argument"
200
+ ],
201
+ JSXSpreadChild: [
202
+ "expression"
203
+ ],
204
+ JSXText: [],
205
+ LabeledStatement: [
206
+ "label",
207
+ "body"
208
+ ],
209
+ Literal: [],
210
+ LogicalExpression: [
211
+ "left",
212
+ "right"
213
+ ],
214
+ MemberExpression: [
215
+ "object",
216
+ "property"
217
+ ],
218
+ MetaProperty: [
219
+ "meta",
220
+ "property"
221
+ ],
222
+ MethodDefinition: [
223
+ "key",
224
+ "value"
225
+ ],
226
+ NewExpression: [
227
+ "callee",
228
+ "arguments"
229
+ ],
230
+ ObjectExpression: [
231
+ "properties"
232
+ ],
233
+ ObjectPattern: [
234
+ "properties"
235
+ ],
236
+ PrivateIdentifier: [],
237
+ Program: [
238
+ "body"
239
+ ],
240
+ Property: [
241
+ "key",
242
+ "value"
243
+ ],
244
+ PropertyDefinition: [
245
+ "key",
246
+ "value"
247
+ ],
248
+ RestElement: [
249
+ "argument"
250
+ ],
251
+ ReturnStatement: [
252
+ "argument"
253
+ ],
254
+ SequenceExpression: [
255
+ "expressions"
256
+ ],
257
+ SpreadElement: [
258
+ "argument"
259
+ ],
260
+ StaticBlock: [
261
+ "body"
262
+ ],
263
+ Super: [],
264
+ SwitchCase: [
265
+ "test",
266
+ "consequent"
267
+ ],
268
+ SwitchStatement: [
269
+ "discriminant",
270
+ "cases"
271
+ ],
272
+ TaggedTemplateExpression: [
273
+ "tag",
274
+ "quasi"
275
+ ],
276
+ TemplateElement: [],
277
+ TemplateLiteral: [
278
+ "quasis",
279
+ "expressions"
280
+ ],
281
+ ThisExpression: [],
282
+ ThrowStatement: [
283
+ "argument"
284
+ ],
285
+ TryStatement: [
286
+ "block",
287
+ "handler",
288
+ "finalizer"
289
+ ],
290
+ UnaryExpression: [
291
+ "argument"
292
+ ],
293
+ UpdateExpression: [
294
+ "argument"
295
+ ],
296
+ VariableDeclaration: [
297
+ "declarations"
298
+ ],
299
+ VariableDeclarator: [
300
+ "id",
301
+ "init"
302
+ ],
303
+ WhileStatement: [
304
+ "test",
305
+ "body"
306
+ ],
307
+ WithStatement: [
308
+ "object",
309
+ "body"
310
+ ],
311
+ YieldExpression: [
312
+ "argument"
313
+ ]
314
+ };
315
+
316
+ // Types.
317
+ const NODE_TYPES = Object.keys(KEYS);
318
+
319
+ // Freeze the keys.
320
+ for (const type of NODE_TYPES) {
321
+ Object.freeze(KEYS[type]);
322
+ }
323
+ Object.freeze(KEYS);
324
+
325
+ /**
326
+ * @author Toru Nagashima <https://github.com/mysticatea>
327
+ * See LICENSE file in root directory for full license.
328
+ */
329
+
330
+ /**
331
+ * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
332
+ */
333
+
334
+ // List to ignore keys.
335
+ const KEY_BLACKLIST = new Set([
336
+ "parent",
337
+ "leadingComments",
338
+ "trailingComments"
339
+ ]);
340
+
341
+ /**
342
+ * Check whether a given key should be used or not.
343
+ * @param {string} key The key to check.
344
+ * @returns {boolean} `true` if the key should be used.
345
+ */
346
+ function filterKey(key) {
347
+ return !KEY_BLACKLIST.has(key) && key[0] !== "_";
348
+ }
349
+
350
+ /**
351
+ * Get visitor keys of a given node.
352
+ * @param {object} node The AST node to get keys.
353
+ * @returns {readonly string[]} Visitor keys of the node.
354
+ */
355
+ function getKeys(node) {
356
+ return Object.keys(node).filter(filterKey);
357
+ }
358
+
359
+ // Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
360
+ // eslint-disable-next-line valid-jsdoc
361
+ /**
362
+ * Make the union set with `KEYS` and given keys.
363
+ * @param {VisitorKeys} additionalKeys The additional keys.
364
+ * @returns {VisitorKeys} The union set.
365
+ */
366
+ function unionWith(additionalKeys) {
367
+ const retv = /** @type {{
368
+ [type: string]: ReadonlyArray<string>
369
+ }} */ (Object.assign({}, KEYS));
370
+
371
+ for (const type of Object.keys(additionalKeys)) {
372
+ if (Object.prototype.hasOwnProperty.call(retv, type)) {
373
+ const keys = new Set(additionalKeys[type]);
374
+
375
+ for (const key of retv[type]) {
376
+ keys.add(key);
377
+ }
378
+
379
+ retv[type] = Object.freeze(Array.from(keys));
380
+ } else {
381
+ retv[type] = Object.freeze(Array.from(additionalKeys[type]));
382
+ }
383
+ }
384
+
385
+ return Object.freeze(retv);
386
+ }
387
+
388
+ eslintVisitorKeys.KEYS = KEYS;
389
+ eslintVisitorKeys.getKeys = getKeys;
390
+ eslintVisitorKeys.unionWith = unionWith;
391
+ return eslintVisitorKeys;
392
+ }
393
+
394
+ export { requireEslintVisitorKeys as r };