Skip to content

Commit 764ecc9

Browse files
committed
refactor(lint): fixed errors
Signed-off-by: Vojtech Masek <[email protected]>
1 parent d9affee commit 764ecc9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/helper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ export function determineDomain({schemes, host, basePath}: Swagger): string {
9393

9494
// if no host exists in the swagger file use a window location relative path
9595
const domain = host
96-
? host
96+
? host // tslint:disable-next-line:no-invalid-template-strings
9797
: '${window.location.hostname}${window.location.port ? \':\'+window.location.port : \'\'}';
98-
/* tslint:disable-line */
9998
const base = ('/' === basePath || !basePath ? '' : basePath);
10099
return `${protocol}${domain}${base}`;
101100
}

src/parser.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function parseMethods({paths, security, parameters}: Swagger): Method[] {
4848
),
4949
methodType: methodType.toUpperCase() as MethodType,
5050
parameters: transformParameters(operation.parameters, parameters || {}),
51+
// tslint:disable-next-line:no-invalid-template-strings
5152
path: pathName.replace(/{(.*?)}/g, '$${args.$1}'), // turn path interpolation `{this}` into string template `${this}
5253
response: prefixImportedModels(determineResponseType(operation.responses)),
5354
summaryLines: operation.description
@@ -85,11 +86,13 @@ function defineEnum(enumSchema: (string | boolean | number | {})[] = [],
8586
): Definition {
8687
const splitDesc = enumDesc.split('\n');
8788
const descKeys: { [key: string]: string } | null = splitDesc.length > 1
88-
? splitDesc
89-
.reduce((acc, cur) => {
89+
? splitDesc.reduce<{ [key: string]: string }>(
90+
(acc, cur) => {
9091
const captured = /(\d) (\w+)/.exec(cur); // parse the `- 42 UltimateAnswer` description syntax
9192
return captured ? {...acc, [captured[1]]: captured[2]} : acc;
92-
}, {})
93+
},
94+
{}
95+
)
9396
: null;
9497

9598
return {

0 commit comments

Comments
 (0)