Skip to content

Commit

Permalink
Fix tslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
Huachao committed May 10, 2024
1 parent c481093 commit 814d962
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/controllers/swaggerController.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as vscode from 'vscode';
import dayjs from 'dayjs';
import * as fs from 'fs';
import * as path from 'path';
import dayjs from 'dayjs';
import * as vscode from 'vscode';
import { SwaggerUtils } from '../utils/swaggerUtils';

export class SwaggerController {
Expand Down Expand Up @@ -32,7 +32,7 @@ export class SwaggerController {
placeHolder: 'Select an option',
});

// Handle the user's selection
// Handle the user's selection
if (selectedItem) {
if (selectedItem === importFromFileItem) {
const options: vscode.OpenDialogOptions = {
Expand Down Expand Up @@ -88,4 +88,4 @@ export class SwaggerController {
vscode.window.showErrorMessage(error.message);
}
}
}
}
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CodeSnippetController } from './controllers/codeSnippetController';
import { EnvironmentController } from './controllers/environmentController';
import { HistoryController } from './controllers/historyController';
import { RequestController } from './controllers/requestController';
import { SwaggerController } from './controllers/swaggerController';
import { CustomVariableDiagnosticsProvider } from "./providers/customVariableDiagnosticsProvider";
import { RequestBodyDocumentLinkProvider } from './providers/documentLinkProvider';
import { EnvironmentOrFileVariableHoverProvider } from './providers/environmentOrFileVariableHoverProvider';
Expand All @@ -22,7 +23,6 @@ import { RequestVariableHoverProvider } from './providers/requestVariableHoverPr
import { AadTokenCache } from './utils/aadTokenCache';
import { ConfigurationDependentRegistration } from './utils/dependentRegistration';
import { UserDataManager } from './utils/userDataManager';
import { SwaggerController } from './controllers/swaggerController';

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
Expand Down
2 changes: 1 addition & 1 deletion src/models/httpRequest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CancelableRequest, Response } from 'got';
import { Stream } from 'stream';
import { getContentType } from '../utils/misc';
import { RequestHeaders } from './base';
import { CancelableRequest, Response } from 'got';

export class HttpRequest {
public isCancelled: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/models/httpResponse.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Timings } from '@szmarczak/http-timer';
import { getContentType } from '../utils/misc';
import { ResponseHeaders } from './base';
import { HttpRequest } from "./httpRequest";
import { Timings } from '@szmarczak/http-timer';

export class HttpResponse {
public constructor(
Expand Down
4 changes: 2 additions & 2 deletions src/utils/httpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import { convertBufferToStream, convertStreamToBuffer } from './streamUtility';
import { UserDataManager } from './userDataManager';
import { getCurrentHttpFileName, getWorkspaceRootPath } from './workspaceUtility';

import { OptionsOfBufferResponseBody, CancelableRequest, Headers, Method, Response } from 'got';
import { CancelableRequest, Headers, Method, OptionsOfBufferResponseBody, Response } from 'got';
import got = require('got');

const encodeUrl = require('encodeurl');
const CookieFileStore = require('tough-cookie-file-store').FileCookieStore
const CookieFileStore = require('tough-cookie-file-store').FileCookieStore;

type Certificate = {
cert?: Buffer;
Expand Down
8 changes: 5 additions & 3 deletions src/utils/swaggerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ export class SwaggerUtils {
} else {
operationBlock += `${operation.toUpperCase()} ${baseUrl}${endpoint} HTTP/1.1\n`;
}
operationBlock += '\n###'
operationBlock += '\n###';
return operationBlock;
}

getExampleObjectFromSchema(components: any, schema: any): any {
if (!schema) return;
if (!schema) {
return;
}

if (schema.$ref) {
const schemaRef = schema.$ref;
Expand Down Expand Up @@ -74,4 +76,4 @@ export class SwaggerUtils {
throw error;
}
}
}
}

0 comments on commit 814d962

Please sign in to comment.