Skip to content

Commit

Permalink
Fix linting in APIs (#20623)
Browse files Browse the repository at this point in the history
Fix lint in api.ts
  • Loading branch information
paulacamargo25 committed Mar 29, 2023
1 parent 34c54f4 commit bc59a7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ src/client/interpreter/helpers.ts
src/client/interpreter/virtualEnvs/condaInheritEnvPrompt.ts
src/client/interpreter/display/index.ts

src/client/api.ts
src/client/extension.ts
src/client/sourceMapSupport.ts
src/client/startupTelemetry.ts
Expand Down
12 changes: 7 additions & 5 deletions src/client/api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

Expand All @@ -16,14 +17,15 @@ import { getDebugpyLauncherArgs, getDebugpyPackagePath } from './debugger/extens
import { IInterpreterService } from './interpreter/contracts';
import { IServiceContainer, IServiceManager } from './ioc/types';
import { JupyterExtensionIntegration } from './jupyter/jupyterIntegration';
import { IDataViewerDataProvider, IJupyterUriProvider } from './jupyter/types';
import { traceError } from './logging';
import { IDiscoveryAPI } from './pythonEnvironments/base/locator';
import { buildEnvironmentApi } from './environmentApi';
import { ApiForPylance } from './pylanceApi';
import { getTelemetryReporter } from './telemetry';

export function buildApi(
ready: Promise<any>,
ready: Promise<void>,
serviceManager: IServiceManager,
serviceContainer: IServiceContainer,
discoveryApi: IDiscoveryAPI,
Expand Down Expand Up @@ -89,7 +91,7 @@ export function buildApi(
async getRemoteLauncherCommand(
host: string,
port: number,
waitUntilDebuggerAttaches: boolean = true,
waitUntilDebuggerAttaches = true,
): Promise<string[]> {
return getDebugpyLauncherArgs({
host,
Expand All @@ -104,7 +106,7 @@ export function buildApi(
settings: {
onDidChangeExecutionDetails: interpreterService.onDidChangeInterpreterConfiguration,
getExecutionDetails(resource?: Resource) {
const pythonPath = configurationService.getSettings(resource).pythonPath;
const { pythonPath } = configurationService.getSettings(resource);
// If pythonPath equals an empty string, no interpreter is set.
return { execCommand: pythonPath === '' ? undefined : [pythonPath] };
},
Expand All @@ -114,10 +116,10 @@ export function buildApi(
datascience: {
registerRemoteServerProvider: jupyterIntegration
? jupyterIntegration.registerRemoteServerProvider.bind(jupyterIntegration)
: (noop as any),
: ((noop as unknown) as (serverProvider: IJupyterUriProvider) => void),
showDataViewer: jupyterIntegration
? jupyterIntegration.showDataViewer.bind(jupyterIntegration)
: (noop as any),
: ((noop as unknown) as (dataProvider: IDataViewerDataProvider, title: string) => Promise<void>),
},
pylance: {
createClient: (...args: any[]): BaseLanguageClient => {
Expand Down

0 comments on commit bc59a7d

Please sign in to comment.