Skip to content

Commit 910449c

Browse files
committed
no await on return
1 parent a25be82 commit 910449c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"groups": [["builtin", "external"], "parent", "sibling", "index"],
5151
"newlines-between": "never"
5252
}
53-
]
53+
],
54+
"no-return-await": "error"
5455
}
5556
}

lib/asyncapi.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class AsyncApiModule {
4040
templateOptions?: AsyncApiTemplateOptions,
4141
) {
4242
const generator = new AsyncapiGenerator(templateOptions);
43-
return await generator.generate(contract).catch((err) => {
43+
return generator.generate(contract).catch((err) => {
4444
this.logger.error(err);
4545
throw err;
4646
});

lib/services/asyncapi.generator.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import Generator from '@asyncapi/generator';
22
import jsyaml from 'js-yaml';
33
import os from 'os';
4-
import { AsyncApiTemplateOptions, GeneratorOptions } from '../interface';
4+
import {
5+
AsyncApiDocument,
6+
AsyncApiTemplateOptions,
7+
GeneratorOptions,
8+
} from '../interface';
59

610
export class AsyncapiGenerator {
711
private readonly generator: GeneratorOptions;
@@ -18,9 +22,9 @@ export class AsyncapiGenerator {
1822
});
1923
}
2024

21-
public async generate(contract: any): Promise<string> {
25+
public async generate(contract: AsyncApiDocument): Promise<string> {
2226
const yaml = jsyaml.dump(contract);
23-
return await this.generator.generateFromString(yaml, {
27+
return this.generator.generateFromString(yaml, {
2428
resolve: {
2529
file: false,
2630
},

0 commit comments

Comments
 (0)