Skip to content

Commit

Permalink
Reflect typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinBakalov committed Jul 4, 2024
1 parent ff56027 commit 8cd82f5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
8 changes: 4 additions & 4 deletions extension/src/__tests__/memento.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* SPDX-License-Identifier: MIT
*/

import { ExtensionContext, Memento } from "vscode"
import { sleep } from "@vmware/vrdt-common"

Check warning on line 6 in extension/src/__tests__/memento.spec.ts

View workflow job for this annotation

GitHub Actions / Build and Release

Unable to resolve path to module '@vmware/vrdt-common'
import { ExtensionContext, Memento } from "vscode"

import { ScopedMemento } from "../client/storage/ScopedMemento"

import "jest-extended"

describe("ScopedMemento", () => {
let storage = {}
let storage = {} as any;

Check failure on line 14 in extension/src/__tests__/memento.spec.ts

View workflow job for this annotation

GitHub Actions / Build and Release

Delete `;`

const MementoMock = jest.fn<Memento, any[]>(() => ({
get: jest.fn((key: string, defaultValue?: any) => {
Expand Down Expand Up @@ -218,7 +218,7 @@ describe("ScopedMemento", () => {
}

for (const k of Object.keys(entries)) {
globalState.set(k, entries[k])
globalState.set(k, (entries as any)[k])
}

const all = globalState.all()
Expand All @@ -239,7 +239,7 @@ describe("ScopedMemento", () => {
}

for (const k of Object.keys(entries)) {
globalState.set(k, entries[k])
globalState.set(k, (entries as any)[k])
}

globalState.clear()
Expand Down
2 changes: 1 addition & 1 deletion extension/src/client/lint/rule/ToolchainVersionRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class ToolchainVersionRule extends PomLintRule {
return null
}

if (PomFile.ParentGroupByArtifact[artifactId] !== groupId) {
if ((PomFile.ParentGroupByArtifact as any)[artifactId] !== groupId) {
this.logger.warn(`Not a valid vRO project parent ID - ${groupId}.${artifactId}`)
return null
}
Expand Down
10 changes: 6 additions & 4 deletions extension/src/client/provider/task/TaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

import * as path from "path"

import { AutoWire, Logger, PomFile, TasksInfo } from "@vmware/vrdt-common"
import * as fs from "fs-extra"
import * as jsonParser from "jsonc-parser"
import * as _ from "lodash"
import * as micromatch from "micromatch"
import { AutoWire, Logger, PomFile, TasksInfo } from "@vmware/vrdt-common"
import * as vscode from "vscode"

import { extensionShortName } from "../../constants"
import { Registrable } from "../../Registrable"
import { TASKS_BY_TOOLCHAIN_PARENT, VrealizeTaskConfiguration } from "./DefaultTasksJson"
import { EnvironmentManager } from "../../system"
import { extensionShortName } from "../../constants"
import { ScopedMemento } from "../../storage/ScopedMemento"
import { EnvironmentManager } from "../../system"
import { TASKS_BY_TOOLCHAIN_PARENT, VrealizeTaskConfiguration } from "./DefaultTasksJson"

interface VrealizeTaskDefinition extends vscode.TaskDefinition {
command: string
Expand Down Expand Up @@ -109,6 +109,8 @@ export class TaskProvider implements vscode.TaskProvider, Registrable {
const pomFile = new PomFile(pomFilePath)

if (!micromatch.any(`${pomFile.groupId}:${pomFile.artifactId}`, excludePatterns)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
const defaultTasks: VrealizeTaskConfiguration[] = TASKS_BY_TOOLCHAIN_PARENT[pomFile.parentId] || []

for (const task of defaultTasks) {
Expand Down
2 changes: 1 addition & 1 deletion extension/src/client/storage/ScopedMemento.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class ScopedMemento {
}

all() {
const items = {}
const items = {} as any;

Check failure on line 112 in extension/src/client/storage/ScopedMemento.ts

View workflow job for this annotation

GitHub Actions / Build and Release

Delete `;`
for (const key in this.state) {
items[key] = this.state[key].value
}
Expand Down
4 changes: 3 additions & 1 deletion extension/src/client/ui/MultiStepMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* SPDX-License-Identifier: MIT
*/

import { InputBox, QuickInputButton, QuickPick, QuickPickItem } from "vscode"
import { Logger } from "@vmware/vrdt-common"
import { InputBox, QuickInputButton, QuickPick, QuickPickItem } from "vscode"

export class BreakMultiStep extends Error {
constructor() {
Expand All @@ -25,6 +25,7 @@ export interface QuickInputStep {
title?: string
maskChars?: boolean
value?: string
isHead?: boolean

onDidClickButton?(input: InputBox, button: QuickInputButton): void
validate?(value: string | undefined): [boolean, string | undefined] | Promise<[boolean, string | undefined]>
Expand All @@ -48,6 +49,7 @@ export interface QuickPickStep<T extends QuickPickItem = any> {
selectedItems?: T[]
title?: string
value?: string
isHead?: boolean

onDidAccept?(quickpick: QuickPick<T>): boolean | Promise<boolean>
onDidChangeValue?(quickpick: QuickPick<T>): boolean | Promise<boolean>
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
"noEmitOnError": false,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"suppressImplicitAnyIndexErrors": true,
"ignoreDeprecations": "5.0",
"strictNullChecks": true,
"strictBindCallApply": true,
"experimentalDecorators": true,
Expand Down

0 comments on commit 8cd82f5

Please sign in to comment.