@murky-web/typebuddy 1.0.0 → 1.1.1

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,247 +1,535 @@
1
1
  type AstNode = {
2
- type: string;
3
- parent?: AstNode;
4
- [key: string]: unknown;
2
+ type: string;
3
+ parent?: AstNode;
4
+ [key: string]: unknown;
5
5
  };
6
6
 
7
7
  type RuleContext = {
8
- getSourceCode(): { getText(node: unknown): string };
9
- report(descriptor: {
10
- node: unknown;
11
- messageId: string;
12
- fix(
13
- fixer: {
14
- replaceText(node: unknown, text: string): unknown;
15
- insertTextBeforeRange(range: [number, number], text: string): unknown;
16
- },
17
- ): unknown;
18
- }): void;
8
+ getSourceCode(): { getText(node: unknown): string };
9
+ report(descriptor: {
10
+ node: unknown;
11
+ messageId: string;
12
+ fix(fixer: {
13
+ replaceText(node: unknown, text: string): unknown;
14
+ insertTextBeforeRange(
15
+ range: [number, number],
16
+ text: string,
17
+ ): unknown;
18
+ }): unknown;
19
+ }): void;
20
+ };
21
+
22
+ type RuleFixer = {
23
+ replaceText(node: unknown, text: string): unknown;
24
+ insertTextBeforeRange(range: [number, number], text: string): unknown;
19
25
  };
20
26
 
21
27
  function isNode(value: unknown): value is AstNode {
22
- return typeof value === "object" && value !== null && "type" in value;
28
+ return typeof value === "object" && value !== null && "type" in value;
23
29
  }
24
30
 
25
31
  function isAsyncFunction(node: AstNode): boolean {
26
- return node.async === true;
32
+ return node.async === true;
27
33
  }
28
34
 
29
35
  function hasTypeParameters(value: unknown): value is { params: unknown[] } {
30
- return isNode(value) && Array.isArray(value.params);
36
+ return isNode(value) && Array.isArray(value.params);
31
37
  }
32
38
 
33
- const rule = {
34
- create(context: RuleContext) {
35
- const sourceCode = context.getSourceCode();
36
-
37
- function isTypeReference(node: unknown): node is AstNode {
38
- return isNode(node) && node.type === "TSTypeReference";
39
+ function isCallArgumentCallback(node: AstNode): boolean {
40
+ const parent = node.parent;
41
+ if (!parent) {
42
+ return false;
39
43
  }
40
44
 
41
- function getTypeName(node: AstNode): string | null {
42
- const typeName = node.typeName;
43
- if (!isNode(typeName) || typeName.type !== "Identifier") return null;
44
- return typeof typeName.name === "string" ? typeName.name : null;
45
+ if (parent.type !== "CallExpression" && parent.type !== "NewExpression") {
46
+ return false;
45
47
  }
46
48
 
47
- function getTypeArgument(node: AstNode): AstNode | null {
48
- const typeArguments = node.typeArguments;
49
- if (!hasTypeParameters(typeArguments)) return null;
50
- const [firstParam] = typeArguments.params;
51
- if (!isNode(firstParam)) return null;
52
- return firstParam;
49
+ return Array.isArray(parent.arguments) && parent.arguments.includes(node);
50
+ }
51
+
52
+ function isIdentifierNamed(node: unknown, name: string): boolean {
53
+ return isNode(node) && node.type === "Identifier" && node.name === name;
54
+ }
55
+
56
+ function getProgram(node: AstNode): AstNode | null {
57
+ let current: AstNode | undefined = node;
58
+
59
+ while (current?.parent) {
60
+ current = current.parent;
53
61
  }
54
62
 
55
- function getPromiseTypeArgument(node: AstNode): AstNode | null {
56
- if (getTypeName(node) !== "Promise") return null;
57
- return getTypeArgument(node);
63
+ return current?.type === "Program" ? current : null;
64
+ }
65
+
66
+ function isImportDeclaration(node: unknown): node is AstNode {
67
+ return isNode(node) && node.type === "ImportDeclaration";
68
+ }
69
+
70
+ function getStringLiteralValue(node: unknown): string | null {
71
+ if (!isNode(node)) {
72
+ return null;
58
73
  }
59
74
 
60
- function checkReturnType(node: AstNode) {
61
- if (!isAsyncFunction(node)) return;
62
- if (!isNode(node.returnType)) return;
75
+ if (
76
+ (node.type === "Literal" || node.type === "StringLiteral") &&
77
+ typeof node.value === "string"
78
+ ) {
79
+ return node.value;
80
+ }
63
81
 
64
- const typeAnnotation = node.returnType.typeAnnotation;
65
- if (!isTypeReference(typeAnnotation)) return;
66
- if (getTypeName(typeAnnotation) !== "Promise") return;
82
+ return null;
83
+ }
67
84
 
68
- const typeName = typeAnnotation.typeName;
69
- context.report({
70
- node: typeName,
71
- messageId: "replaceWithMaybePromise",
72
- fix(fixer) {
73
- return fixer.replaceText(typeName, "MaybePromise");
74
- },
75
- });
85
+ function getProgramBody(node: AstNode): AstNode[] {
86
+ if (!Array.isArray(node.body)) {
87
+ return [];
76
88
  }
77
89
 
78
- function wrapReturnValue(
79
- node: AstNode,
80
- isAsync: boolean,
81
- returnType: AstNode | null,
90
+ return node.body.filter(isNode);
91
+ }
92
+
93
+ function isResultHelperCall(node: unknown, name: "ok" | "err"): boolean {
94
+ return (
95
+ isNode(node) &&
96
+ node.type === "CallExpression" &&
97
+ isIdentifierNamed(node.callee, name)
98
+ );
99
+ }
100
+
101
+ function hasIsErrorFlag(node: unknown, expected: boolean): boolean {
102
+ if (
103
+ !isNode(node) ||
104
+ node.type !== "ObjectExpression" ||
105
+ !Array.isArray(node.properties)
82
106
  ) {
83
- if (!isAsync) return;
84
-
85
- const argument = node.argument;
86
- if (!isNode(argument)) {
87
- if (returnType?.type === "TSVoidKeyword") {
88
- context.report({
89
- node,
90
- messageId: "returnVoidPromise",
91
- fix(fixer) {
92
- return fixer.replaceText(node, "return VOID_PROMISE");
93
- },
94
- });
95
- }
96
- return;
97
- }
98
-
99
- if (
100
- argument.type === "Identifier" &&
101
- (argument.name === "VOID_PROMISE" || argument.name === "FAILED_PROMISE")
102
- ) {
103
- return;
104
- }
105
-
106
- const hasIsErrorProperty =
107
- argument.type === "ObjectExpression" &&
108
- Array.isArray(argument.properties) &&
109
- argument.properties.some(
110
- (property) =>
107
+ return false;
108
+ }
109
+
110
+ return node.properties.some((property) => {
111
+ return (
111
112
  isNode(property) &&
112
113
  property.type === "Property" &&
113
- isNode(property.key) &&
114
- property.key.type === "Identifier" &&
115
- property.key.name === "isError",
114
+ isIdentifierNamed(property.key, "isError") &&
115
+ isNode(property.value) &&
116
+ property.value.type === "Literal" &&
117
+ property.value.value === expected
116
118
  );
119
+ });
120
+ }
117
121
 
118
- if (!hasIsErrorProperty) {
119
- context.report({
120
- node: argument,
121
- messageId: "wrapReturn",
122
- fix(fixer) {
123
- const argumentText = sourceCode.getText(argument);
124
- return fixer.replaceText(
125
- argument,
126
- `{ value: ${argumentText}, isError: false }`,
127
- );
128
- },
129
- });
130
- }
122
+ function getObjectPropertyValue(
123
+ node: unknown,
124
+ propertyName: string,
125
+ ): AstNode | null {
126
+ if (
127
+ !isNode(node) ||
128
+ node.type !== "ObjectExpression" ||
129
+ !Array.isArray(node.properties)
130
+ ) {
131
+ return null;
131
132
  }
132
133
 
133
- function processTryCatch(node: AstNode) {
134
- let parent = node.parent;
135
- let isAsync = false;
136
- let parentFunction: AstNode | null = null;
134
+ for (const property of node.properties) {
135
+ if (
136
+ isNode(property) &&
137
+ property.type === "Property" &&
138
+ isIdentifierNamed(property.key, propertyName) &&
139
+ isNode(property.value)
140
+ ) {
141
+ return property.value;
142
+ }
143
+ }
144
+
145
+ return null;
146
+ }
147
+
148
+ function isBooleanLiteral(node: unknown, expected: boolean): boolean {
149
+ return isNode(node) && node.type === "Literal" && node.value === expected;
150
+ }
151
+
152
+ function isNullLiteral(node: unknown): boolean {
153
+ return isNode(node) && node.type === "Literal" && node.value === null;
154
+ }
155
+
156
+ function hasTypeBuddyHelperImport(program: AstNode, helperName: "ok" | "err") {
157
+ return getProgramBody(program).some((statement) => {
158
+ if (!isImportDeclaration(statement)) {
159
+ return false;
160
+ }
137
161
 
138
- while (parent) {
139
162
  if (
140
- parent.type === "FunctionDeclaration" ||
141
- parent.type === "FunctionExpression" ||
142
- parent.type === "ArrowFunctionExpression"
163
+ getStringLiteralValue(statement.source) !== "@murky-web/typebuddy"
143
164
  ) {
144
- isAsync = parent.async === true;
145
- parentFunction = parent;
146
- break;
165
+ return false;
166
+ }
167
+
168
+ if (statement.importKind === "type") {
169
+ return false;
170
+ }
171
+
172
+ const specifiers = Array.isArray(statement.specifiers)
173
+ ? statement.specifiers
174
+ : [];
175
+
176
+ return specifiers.some((specifier) => {
177
+ return (
178
+ isNode(specifier) &&
179
+ specifier.type === "ImportSpecifier" &&
180
+ isIdentifierNamed(specifier.local, helperName)
181
+ );
182
+ });
183
+ });
184
+ }
185
+
186
+ function getTypeBuddyImportInsertRange(
187
+ program: AstNode,
188
+ ): [number, number] | null {
189
+ const body = getProgramBody(program);
190
+ const imports = body.filter(isImportDeclaration);
191
+ const anchor = imports.at(-1) ?? body[0] ?? program;
192
+
193
+ if (!Array.isArray(anchor.range) || anchor.range.length < 2) {
194
+ return null;
195
+ }
196
+
197
+ if (imports.length > 0) {
198
+ return [anchor.range[1], anchor.range[1]];
199
+ }
200
+
201
+ return [anchor.range[0], anchor.range[0]];
202
+ }
203
+
204
+ const rule = {
205
+ create(context: RuleContext) {
206
+ const sourceCode = context.getSourceCode();
207
+ const scheduledHelperImports = new Set<"ok" | "err">();
208
+
209
+ function isTypeReference(node: unknown): node is AstNode {
210
+ return isNode(node) && node.type === "TSTypeReference";
211
+ }
212
+
213
+ function getTypeName(node: AstNode): string | null {
214
+ const typeName = node.typeName;
215
+ if (!isNode(typeName) || typeName.type !== "Identifier")
216
+ return null;
217
+ return typeof typeName.name === "string" ? typeName.name : null;
147
218
  }
148
- parent = parent.parent;
149
- }
150
219
 
151
- if (!isAsync || !parentFunction) return;
220
+ function getTypeArgument(node: AstNode): AstNode | null {
221
+ const typeArguments = node.typeArguments;
222
+ if (!hasTypeParameters(typeArguments)) return null;
223
+ const [firstParam] = typeArguments.params;
224
+ if (!isNode(firstParam)) return null;
225
+ return firstParam;
226
+ }
152
227
 
153
- let returnType: AstNode | null = null;
154
- if (isNode(parentFunction.returnType)) {
155
- const typeAnnotation = parentFunction.returnType.typeAnnotation;
156
- if (isTypeReference(typeAnnotation)) {
157
- returnType = getPromiseTypeArgument(typeAnnotation);
228
+ function getPromiseTypeArgument(node: AstNode): AstNode | null {
229
+ if (getTypeName(node) !== "Promise") return null;
230
+ return getTypeArgument(node);
158
231
  }
159
- }
160
-
161
- const blockBody = isNode(node.block) && Array.isArray(node.block.body)
162
- ? node.block.body
163
- : [];
164
- for (const statement of blockBody) {
165
- if (isNode(statement) && statement.type === "ReturnStatement") {
166
- wrapReturnValue(statement, isAsync, returnType);
232
+
233
+ function ensureResultHelperImportFixes(
234
+ node: AstNode,
235
+ fixer: RuleFixer,
236
+ helperName: "ok" | "err",
237
+ ): unknown[] {
238
+ if (scheduledHelperImports.has(helperName)) {
239
+ return [];
240
+ }
241
+
242
+ const program = getProgram(node);
243
+ if (!program || hasTypeBuddyHelperImport(program, helperName)) {
244
+ return [];
245
+ }
246
+
247
+ const insertRange = getTypeBuddyImportInsertRange(program);
248
+ if (!insertRange) {
249
+ return [];
250
+ }
251
+
252
+ scheduledHelperImports.add(helperName);
253
+
254
+ const hasImports = insertRange[0] !== 0;
255
+ const importText = hasImports
256
+ ? `\nimport { ${helperName} } from "@murky-web/typebuddy";`
257
+ : `import { ${helperName} } from "@murky-web/typebuddy";\n`;
258
+
259
+ return [fixer.insertTextBeforeRange(insertRange, importText)];
167
260
  }
168
- }
169
-
170
- if (!isNode(node.handler) || !isNode(node.handler.body)) return;
171
- const catchBody = Array.isArray(node.handler.body.body)
172
- ? node.handler.body.body.filter(isNode)
173
- : [];
174
-
175
- const hasCorrectReturn = catchBody.some(
176
- (statement) =>
177
- statement.type === "ReturnStatement" &&
178
- isNode(statement.argument) &&
179
- statement.argument.type === "Identifier" &&
180
- statement.argument.name === "FAILED_PROMISE",
181
- );
182
-
183
- if (!hasCorrectReturn) {
184
- context.report({
185
- node: node.handler,
186
- messageId: "returnFailedPromise",
187
- fix(fixer) {
188
- const lastStatement = catchBody.at(-1);
261
+
262
+ function checkReturnType(node: AstNode) {
263
+ if (!isAsyncFunction(node)) return;
264
+ if (isCallArgumentCallback(node)) return;
265
+ if (!isNode(node.returnType)) return;
266
+
267
+ const typeAnnotation = node.returnType.typeAnnotation;
268
+ if (!isTypeReference(typeAnnotation)) return;
269
+ if (getTypeName(typeAnnotation) !== "Promise") return;
270
+
271
+ const typeName = typeAnnotation.typeName;
272
+ context.report({
273
+ node: typeName,
274
+ messageId: "replaceWithMaybePromise",
275
+ fix(fixer) {
276
+ return fixer.replaceText(typeName, "MaybePromise");
277
+ },
278
+ });
279
+ }
280
+
281
+ function wrapReturnValue(
282
+ node: AstNode,
283
+ isAsync: boolean,
284
+ returnType: AstNode | null,
285
+ ) {
286
+ if (!isAsync) return;
287
+
288
+ const argument = node.argument;
289
+ if (!isNode(argument)) {
290
+ if (returnType?.type === "TSVoidKeyword") {
291
+ context.report({
292
+ node,
293
+ messageId: "returnVoidPromise",
294
+ fix(fixer) {
295
+ return [
296
+ ...ensureResultHelperImportFixes(
297
+ node,
298
+ fixer,
299
+ "ok",
300
+ ),
301
+ fixer.replaceText(node, "return ok()"),
302
+ ];
303
+ },
304
+ });
305
+ }
306
+ return;
307
+ }
308
+
189
309
  if (
190
- lastStatement?.type === "ReturnStatement" &&
191
- isNode(lastStatement.argument) &&
192
- lastStatement.argument.type === "ObjectExpression"
310
+ argument.type === "Identifier" &&
311
+ (argument.name === "VOID_PROMISE" ||
312
+ argument.name === "FAILED_PROMISE")
193
313
  ) {
194
- return fixer.replaceText(lastStatement, "return FAILED_PROMISE");
314
+ return;
195
315
  }
196
316
 
197
- const handler = node.handler;
198
- if (!isNode(handler)) {
199
- return null;
317
+ if (
318
+ isResultHelperCall(argument, "ok") ||
319
+ isResultHelperCall(argument, "err")
320
+ ) {
321
+ return;
200
322
  }
201
323
 
202
- const bodyRange = handler.body;
203
- if (!isNode(bodyRange) || !Array.isArray(bodyRange.range)) {
204
- return null;
324
+ const isErrorValue = getObjectPropertyValue(argument, "isError");
325
+ const objectValue = getObjectPropertyValue(argument, "value");
326
+
327
+ if (isBooleanLiteral(isErrorValue, false) && objectValue) {
328
+ context.report({
329
+ node: argument,
330
+ messageId: "preferOkResult",
331
+ fix(fixer) {
332
+ const valueText = sourceCode.getText(objectValue);
333
+ return [
334
+ ...ensureResultHelperImportFixes(node, fixer, "ok"),
335
+ fixer.replaceText(argument, `ok(${valueText})`),
336
+ ];
337
+ },
338
+ });
339
+ return;
205
340
  }
206
341
 
207
- return fixer.insertTextBeforeRange(
208
- [bodyRange.range[1] - 1, bodyRange.range[1] - 1],
209
- "return FAILED_PROMISE; ",
342
+ if (
343
+ isBooleanLiteral(isErrorValue, true) &&
344
+ isNullLiteral(objectValue)
345
+ ) {
346
+ context.report({
347
+ node: argument,
348
+ messageId: "preferErrResult",
349
+ fix(fixer) {
350
+ return [
351
+ ...ensureResultHelperImportFixes(
352
+ node,
353
+ fixer,
354
+ "err",
355
+ ),
356
+ fixer.replaceText(argument, "err()"),
357
+ ];
358
+ },
359
+ });
360
+ return;
361
+ }
362
+
363
+ if (
364
+ !hasIsErrorFlag(argument, true) &&
365
+ !hasIsErrorFlag(argument, false)
366
+ ) {
367
+ context.report({
368
+ node: argument,
369
+ messageId: "wrapReturn",
370
+ fix(fixer) {
371
+ const argumentText = sourceCode.getText(argument);
372
+ return [
373
+ ...ensureResultHelperImportFixes(node, fixer, "ok"),
374
+ fixer.replaceText(argument, `ok(${argumentText})`),
375
+ ];
376
+ },
377
+ });
378
+ }
379
+ }
380
+
381
+ function processTryCatch(node: AstNode) {
382
+ let parent = node.parent;
383
+ let isAsync = false;
384
+ let parentFunction: AstNode | null = null;
385
+
386
+ while (parent) {
387
+ if (
388
+ parent.type === "FunctionDeclaration" ||
389
+ parent.type === "FunctionExpression" ||
390
+ parent.type === "ArrowFunctionExpression"
391
+ ) {
392
+ isAsync = parent.async === true;
393
+ parentFunction = parent;
394
+ break;
395
+ }
396
+ parent = parent.parent;
397
+ }
398
+
399
+ if (!isAsync || !parentFunction) return;
400
+ if (isCallArgumentCallback(parentFunction)) return;
401
+
402
+ let returnType: AstNode | null = null;
403
+ if (isNode(parentFunction.returnType)) {
404
+ const typeAnnotation = parentFunction.returnType.typeAnnotation;
405
+ if (isTypeReference(typeAnnotation)) {
406
+ returnType = getPromiseTypeArgument(typeAnnotation);
407
+ }
408
+ }
409
+
410
+ const blockBody =
411
+ isNode(node.block) && Array.isArray(node.block.body)
412
+ ? node.block.body
413
+ : [];
414
+ for (const statement of blockBody) {
415
+ if (isNode(statement) && statement.type === "ReturnStatement") {
416
+ wrapReturnValue(statement, isAsync, returnType);
417
+ }
418
+ }
419
+
420
+ if (!isNode(node.handler) || !isNode(node.handler.body)) return;
421
+ const catchBody = Array.isArray(node.handler.body.body)
422
+ ? node.handler.body.body.filter(isNode)
423
+ : [];
424
+
425
+ for (const statement of catchBody) {
426
+ if (
427
+ statement.type === "ReturnStatement" &&
428
+ isNode(statement.argument)
429
+ ) {
430
+ wrapReturnValue(statement, isAsync, returnType);
431
+ }
432
+ }
433
+
434
+ const hasCorrectReturn = catchBody.some(
435
+ (statement) =>
436
+ statement.type === "ReturnStatement" &&
437
+ isNode(statement.argument) &&
438
+ ((statement.argument.type === "Identifier" &&
439
+ statement.argument.name === "FAILED_PROMISE") ||
440
+ isResultHelperCall(statement.argument, "err") ||
441
+ hasIsErrorFlag(statement.argument, true)),
210
442
  );
211
- },
212
- });
213
- }
214
- }
215
443
 
216
- return {
217
- FunctionDeclaration: checkReturnType,
218
- FunctionExpression: checkReturnType,
219
- ArrowFunctionExpression: checkReturnType,
220
- TSDeclareFunction: checkReturnType,
221
- TSFunctionType: checkReturnType,
222
- TSMethodSignature: checkReturnType,
223
- TryStatement: processTryCatch,
224
- };
225
- },
226
- defaultOptions: [],
227
- meta: {
228
- type: "suggestion",
229
- docs: {
230
- description:
231
- "Ensure async functions' return values follow the MaybePromise pattern.",
444
+ if (!hasCorrectReturn) {
445
+ context.report({
446
+ node: node.handler,
447
+ messageId: "returnFailedPromise",
448
+ fix(fixer) {
449
+ const lastStatement = catchBody.at(-1);
450
+ if (
451
+ lastStatement?.type === "ReturnStatement" &&
452
+ isNode(lastStatement.argument) &&
453
+ lastStatement.argument.type === "ObjectExpression"
454
+ ) {
455
+ return [
456
+ ...ensureResultHelperImportFixes(
457
+ node,
458
+ fixer,
459
+ "err",
460
+ ),
461
+ fixer.replaceText(
462
+ lastStatement,
463
+ "return err()",
464
+ ),
465
+ ];
466
+ }
467
+
468
+ const handler = node.handler;
469
+ if (!isNode(handler)) {
470
+ return null;
471
+ }
472
+
473
+ const bodyRange = handler.body;
474
+ if (
475
+ !isNode(bodyRange) ||
476
+ !Array.isArray(bodyRange.range)
477
+ ) {
478
+ return null;
479
+ }
480
+
481
+ return [
482
+ ...ensureResultHelperImportFixes(
483
+ node,
484
+ fixer,
485
+ "err",
486
+ ),
487
+ fixer.insertTextBeforeRange(
488
+ [
489
+ bodyRange.range[1] - 1,
490
+ bodyRange.range[1] - 1,
491
+ ],
492
+ "return err(); ",
493
+ ),
494
+ ];
495
+ },
496
+ });
497
+ }
498
+ }
499
+
500
+ return {
501
+ FunctionDeclaration: checkReturnType,
502
+ FunctionExpression: checkReturnType,
503
+ ArrowFunctionExpression: checkReturnType,
504
+ TSDeclareFunction: checkReturnType,
505
+ TSFunctionType: checkReturnType,
506
+ TSMethodSignature: checkReturnType,
507
+ TryStatement: processTryCatch,
508
+ };
232
509
  },
233
- fixable: "code",
234
- schema: [],
235
- messages: {
236
- replaceWithMaybePromise:
237
- "Use 'MaybePromise' instead of 'Promise' as the return type in async functions.",
238
- wrapReturn: "Wrap return value with { value: value, isError: false }.",
239
- returnVoidPromise:
240
- "Return VOID_PROMISE for async functions with Promise<void> return type.",
241
- returnFailedPromise:
242
- "Return FAILED_PROMISE in catch block of async functions.",
510
+ defaultOptions: [],
511
+ meta: {
512
+ type: "suggestion",
513
+ docs: {
514
+ description:
515
+ "Ensure async functions' return values follow the MaybePromise pattern.",
516
+ },
517
+ fixable: "code",
518
+ schema: [],
519
+ messages: {
520
+ replaceWithMaybePromise:
521
+ "Use 'MaybePromise' instead of 'Promise' as the return type in async functions.",
522
+ wrapReturn: "Wrap return value with ok(value).",
523
+ preferOkResult:
524
+ "Use ok(value) instead of an inline success result object.",
525
+ preferErrResult:
526
+ "Use err() instead of an inline error result object.",
527
+ returnVoidPromise:
528
+ "Return ok() for async functions with Promise<void> return type.",
529
+ returnFailedPromise:
530
+ "Return err() in the catch block of async functions.",
531
+ },
243
532
  },
244
- },
245
533
  };
246
534
 
247
535
  export { rule as errorSafeAsyncRule };