diff --git a/src/snyk/cli/cliExecutable.ts b/src/snyk/cli/cliExecutable.ts index 8275636ea..4db555edd 100644 --- a/src/snyk/cli/cliExecutable.ts +++ b/src/snyk/cli/cliExecutable.ts @@ -37,7 +37,7 @@ export class CliExecutable { windows_arm64: 'snyk-win.exe', }; - constructor(public readonly version: string, public readonly checksum: Checksum) { } + constructor(public readonly version: string, public readonly checksum: Checksum) {} static async getPath(customPath?: string): Promise { if (customPath) { diff --git a/src/snyk/common/download/downloader.ts b/src/snyk/common/download/downloader.ts index ce89fda7a..11542e9cc 100644 --- a/src/snyk/common/download/downloader.ts +++ b/src/snyk/common/download/downloader.ts @@ -26,7 +26,7 @@ export class Downloader { private readonly window: IVSCodeWindow, private readonly logger: ILog, private readonly extensionContext: ExtensionContext, - ) { } + ) {} /** * Downloads CLI. Existing executable is deleted. */ @@ -46,7 +46,7 @@ export class Downloader { private async getCliExecutable(platform: CliSupportedPlatform): Promise { const cliPath = await this.configuration.getCliPath(); - const cliDir = path.dirname(cliPath);; + const cliDir = path.dirname(cliPath); mkdirSync(cliDir, { recursive: true }); if (await this.binaryExists(cliPath)) { await this.deleteFileAtPath(cliPath); diff --git a/src/snyk/common/languageServer/languageServer.ts b/src/snyk/common/languageServer/languageServer.ts index 3cfa6d2dc..11ee70504 100644 --- a/src/snyk/common/languageServer/languageServer.ts +++ b/src/snyk/common/languageServer/languageServer.ts @@ -161,10 +161,7 @@ export class LanguageServer implements ILanguageServer { // Initialization options are not semantically equal to server settings, thus separated here // https://github.com/microsoft/language-server-protocol/issues/567 async getInitializationOptions(): Promise { - const settings = await LanguageServerSettings.fromConfiguration( - this.configuration, - this.user, - ); + const settings = await LanguageServerSettings.fromConfiguration(this.configuration, this.user); return settings; } diff --git a/src/snyk/common/languageServer/middleware.ts b/src/snyk/common/languageServer/middleware.ts index 11941e91c..3f920fb23 100644 --- a/src/snyk/common/languageServer/middleware.ts +++ b/src/snyk/common/languageServer/middleware.ts @@ -20,7 +20,7 @@ type LanguageClientWorkspaceMiddleware = Partial & { }; export class LanguageClientMiddleware implements Middleware { - constructor(private configuration: IConfiguration, private user: User, private extensionContext: ExtensionContext) { } + constructor(private configuration: IConfiguration, private user: User, private extensionContext: ExtensionContext) {} workspace: LanguageClientWorkspaceMiddleware = { configuration: async ( @@ -41,10 +41,7 @@ export class LanguageClientMiddleware implements Middleware { return []; } - const serverSettings = await LanguageServerSettings.fromConfiguration( - this.configuration, - this.user, - ); + const serverSettings = await LanguageServerSettings.fromConfiguration(this.configuration, this.user); return [serverSettings]; }, }; diff --git a/src/snyk/common/languageServer/settings.ts b/src/snyk/common/languageServer/settings.ts index 80fcdda1c..ad4eb9764 100644 --- a/src/snyk/common/languageServer/settings.ts +++ b/src/snyk/common/languageServer/settings.ts @@ -49,10 +49,7 @@ export type ServerSettings = { }; export class LanguageServerSettings { - static async fromConfiguration( - configuration: IConfiguration, - user: User, - ): Promise { + static async fromConfiguration(configuration: IConfiguration, user: User): Promise { const featuresConfiguration = configuration.getFeaturesConfiguration(); const ossEnabled = _.isUndefined(featuresConfiguration.ossEnabled) ? true : featuresConfiguration.ossEnabled; diff --git a/src/snyk/common/services/downloadService.ts b/src/snyk/common/services/downloadService.ts index 2e368c891..9d30706ba 100644 --- a/src/snyk/common/services/downloadService.ts +++ b/src/snyk/common/services/downloadService.ts @@ -90,9 +90,7 @@ export class DownloadService { } async isCliInstalled() { - const cliExecutableExists = await CliExecutable.exists( - this.extensionContext.extensionPath, - ); + const cliExecutableExists = await CliExecutable.exists(this.extensionContext.extensionPath); const cliChecksumWritten = !!this.getCliChecksum(); return cliExecutableExists && cliChecksumWritten; @@ -111,6 +109,7 @@ export class DownloadService { try { await fsPromises.unlink(path); } catch { + // eslint-disable-next-line no-empty } await this.configuration.setCliPath(await CliExecutable.getPath()); return true; diff --git a/src/test/unit/common/languageServer/middleware.test.ts b/src/test/unit/common/languageServer/middleware.test.ts index b0a3d2d8f..95ce7342c 100644 --- a/src/test/unit/common/languageServer/middleware.test.ts +++ b/src/test/unit/common/languageServer/middleware.test.ts @@ -110,10 +110,7 @@ suite('Language Server: Middleware', () => { serverResult.manageBinariesAutomatically, `${configuration.isAutomaticDependencyManagementEnabled()}`, ); - assert.strictEqual( - serverResult.cliPath, - await configuration.getCliPath(), - ); + assert.strictEqual(serverResult.cliPath, await configuration.getCliPath()); assert.strictEqual(serverResult.enableTrustedFoldersFeature, 'true'); assert.deepStrictEqual(serverResult.trustedFolders, configuration.getTrustedFolders()); }); diff --git a/src/test/unit/common/languageServer/settings.test.ts b/src/test/unit/common/languageServer/settings.test.ts index 526b1dc9d..d40fb7ef2 100644 --- a/src/test/unit/common/languageServer/settings.test.ts +++ b/src/test/unit/common/languageServer/settings.test.ts @@ -46,10 +46,7 @@ suite('LanguageServerSettings', () => { scanningMode: 'scan-mode', } as unknown as IConfiguration; - const serverSettings = await LanguageServerSettings.fromConfiguration( - mockConfiguration, - mockUser, - ); + const serverSettings = await LanguageServerSettings.fromConfiguration(mockConfiguration, mockUser); assert.strictEqual(serverSettings.activateSnykCodeSecurity, 'true'); assert.strictEqual(serverSettings.activateSnykCodeQuality, 'true');