Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
eslint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xingsy97 committed Feb 26, 2024
1 parent 6225ff1 commit d42e714
Show file tree
Hide file tree
Showing 69 changed files with 219 additions and 177 deletions.
3 changes: 2 additions & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { CommandCallback, IActionContext, IParsedError, openUrl, parseError, registerCommandWithTreeNodeUnwrapping, registerErrorHandler, registerReportIssueCommand } from '@microsoft/vscode-azext-utils';
import { type CommandCallback, type IActionContext, type IParsedError} from '@microsoft/vscode-azext-utils';
import { openUrl, parseError, registerCommandWithTreeNodeUnwrapping, registerErrorHandler, registerReportIssueCommand } from '@microsoft/vscode-azext-utils';
import { instrumentOperation } from 'vscode-extension-telemetry-wrapper';
import { showError } from './utils';
import { createHubSetting } from './workflows/hubSetting/create/createHubSetting';
Expand Down
5 changes: 3 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
'use strict';

import { registerAzureUtilsExtensionVariables } from '@microsoft/vscode-azext-azureutils';
import { IActionContext, TreeElementStateManager, callWithTelemetryAndErrorHandling, createAzExtOutputChannel, createExperimentationService, registerUIExtensionVariables } from '@microsoft/vscode-azext-utils';
import { type IActionContext} from '@microsoft/vscode-azext-utils';
import { TreeElementStateManager, callWithTelemetryAndErrorHandling, createAzExtOutputChannel, createExperimentationService, registerUIExtensionVariables } from '@microsoft/vscode-azext-utils';
import { getAzureResourcesExtensionApi } from '@microsoft/vscode-azureresources-api';
import * as vscode from 'vscode';
import type * as vscode from 'vscode';
import { registerCommands } from './commands';
import { ext } from './extensionVariables';
import { ServicesDataProvider } from "./tree/ServicesDataProvider";
Expand Down
10 changes: 5 additions & 5 deletions src/extensionVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IAzExtOutputChannel, IExperimentationServiceAdapter, TreeElementStateManager } from "@microsoft/vscode-azext-utils";
import { AzureResourcesExtensionApi } from "@microsoft/vscode-azureresources-api";
import { ExtensionContext } from "vscode";
import { ServicesDataProvider } from "./tree/ServicesDataProvider";
import { HubSettingFileSystem } from "./workflows/hub/update/HubSettingFileSystem";
import { type IAzExtOutputChannel, type IExperimentationServiceAdapter, type TreeElementStateManager } from "@microsoft/vscode-azext-utils";
import { type AzureResourcesExtensionApi } from "@microsoft/vscode-azureresources-api";
import { type ExtensionContext } from "vscode";
import { type ServicesDataProvider } from "./tree/ServicesDataProvider";
import { type HubSettingFileSystem } from "./workflows/hub/update/HubSettingFileSystem";

/**
* Namespace for common variables used throughout the extension. They must be initialized in the activate() method of extension.ts
Expand Down
5 changes: 3 additions & 2 deletions src/tree/ServicesDataProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IActionContext, TreeElementBase, callWithTelemetryAndErrorHandling, nonNullProp } from "@microsoft/vscode-azext-utils";
import { AzureResource, AzureResourceBranchDataProvider } from '@microsoft/vscode-azureresources-api';
import { type IActionContext, type TreeElementBase} from "@microsoft/vscode-azext-utils";
import { callWithTelemetryAndErrorHandling, nonNullProp } from "@microsoft/vscode-azext-utils";
import { type AzureResource, type AzureResourceBranchDataProvider } from '@microsoft/vscode-azureresources-api';
import * as vscode from 'vscode';
import { ext } from "../../extension.bundle";
import { ServiceItem } from "./service/ServiceItem";
Expand Down
13 changes: 8 additions & 5 deletions src/tree/hub/HubItem.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { AzureWizard, DeleteConfirmationStep, IActionContext, TreeElementBase, createContextValue, createGenericElement, createSubscriptionContext, nonNullValueAndProp } from "@microsoft/vscode-azext-utils";
import { AzureSubscription, type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api';
import { type IActionContext, type TreeElementBase} from "@microsoft/vscode-azext-utils";
import { AzureWizard, DeleteConfirmationStep, createContextValue, createGenericElement, createSubscriptionContext, nonNullValueAndProp } from "@microsoft/vscode-azext-utils";
import { type AzureSubscription} from '@microsoft/vscode-azureresources-api';
import { type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api';
import * as vscode from 'vscode';
import { ThemeIcon } from "vscode";
import { ext } from "../../../extension.bundle";
import { createActivityContext, createPortalUrl, createWebPubSubHubsClient, localize } from '../../utils';
import { IDeleteHubSettingContext } from "../../workflows/hubSetting/delete/IDeleteHubContext";
import { type IDeleteHubSettingContext } from "../../workflows/hubSetting/delete/IDeleteHubContext";
import { DeleteServiceStep } from "../../workflows/service/delete/DeleteServiceStep";
import { CreateWebPubSubHubModel, WebPubSubHubModel } from "../models";
import { ServiceItem } from "../service/ServiceItem";
import { type WebPubSubHubModel } from "../models";
import { CreateWebPubSubHubModel } from "../models";
import { type ServiceItem } from "../service/ServiceItem";
import { EventHandlersItem } from "./properties/EventHandlersItem";
import { EventListenersItem } from "./properties/EventListenersItem";

Expand Down
11 changes: 7 additions & 4 deletions src/tree/hub/HubsItem.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { uiUtils } from "@microsoft/vscode-azext-azureutils";
import { IActionContext, TreeElementBase, callWithTelemetryAndErrorHandling, createContextValue, createSubscriptionContext } from "@microsoft/vscode-azext-utils";
import { AzureSubscription, type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api';
import { type IActionContext, type TreeElementBase} from "@microsoft/vscode-azext-utils";
import { callWithTelemetryAndErrorHandling, createContextValue, createSubscriptionContext } from "@microsoft/vscode-azext-utils";
import { type AzureSubscription} from '@microsoft/vscode-azureresources-api';
import { type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api';
import * as vscode from 'vscode';
import { ThemeIcon } from "vscode";
import { createWebPubSubHubsAPIClient } from "../../utils";
import { CreateWebPubSubHubModel, WebPubSubHubModel } from "../models";
import { ServiceItem } from "../service/ServiceItem";
import { type WebPubSubHubModel } from "../models";
import { CreateWebPubSubHubModel } from "../models";
import { type ServiceItem } from "../service/ServiceItem";
import { treeUtils } from "../treeUtils";
import { HubItem } from "./HubItem";

Expand Down
9 changes: 5 additions & 4 deletions src/tree/hub/properties/EventHandlerItem.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { EventHandler } from "@azure/arm-webpubsub";
import { TreeElementBase, createContextValue } from "@microsoft/vscode-azext-utils";
import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import { type EventHandler } from "@azure/arm-webpubsub";
import { type TreeElementBase} from "@microsoft/vscode-azext-utils";
import { createContextValue } from "@microsoft/vscode-azext-utils";
import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import * as vscode from 'vscode';
import { MarkdownString, ThemeIcon } from "vscode";
import { EventHandlersItem } from "./EventHandlersItem";
import { type EventHandlersItem } from "./EventHandlersItem";


export class EventHandlerItem implements TreeElementBase {
Expand Down
9 changes: 5 additions & 4 deletions src/tree/hub/properties/EventHandlersItem.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { EventHandler } from "@azure/arm-webpubsub";
import { TreeElementBase, createContextValue } from "@microsoft/vscode-azext-utils";
import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import { type EventHandler } from "@azure/arm-webpubsub";
import { type TreeElementBase} from "@microsoft/vscode-azext-utils";
import { createContextValue } from "@microsoft/vscode-azext-utils";
import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import * as vscode from 'vscode';
import { ThemeIcon } from "vscode";
import { HubItem } from "../HubItem";
import { type HubItem } from "../HubItem";
import { EventHandlerItem } from "./EventHandlerItem";


Expand Down
9 changes: 5 additions & 4 deletions src/tree/hub/properties/EventListenerItem.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { EventListener } from "@azure/arm-webpubsub";
import { TreeElementBase, createContextValue } from "@microsoft/vscode-azext-utils";
import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import { HubsItem } from "src/tree/hub/HubsItem";
import { type EventListener } from "@azure/arm-webpubsub";
import { type TreeElementBase} from "@microsoft/vscode-azext-utils";
import { createContextValue } from "@microsoft/vscode-azext-utils";
import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import { type HubsItem } from "src/tree/hub/HubsItem";
import * as vscode from 'vscode';
import { MarkdownString, ThemeIcon } from "vscode";

Expand Down
7 changes: 4 additions & 3 deletions src/tree/hub/properties/EventListenersItem.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { EventListener } from "@azure/arm-webpubsub";
import { TreeElementBase, createContextValue } from "@microsoft/vscode-azext-utils";
import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import { type EventListener } from "@azure/arm-webpubsub";
import { type TreeElementBase} from "@microsoft/vscode-azext-utils";
import { createContextValue } from "@microsoft/vscode-azext-utils";
import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import * as vscode from 'vscode';
import { ThemeIcon } from "vscode";
import { EventListenerItem } from "./EventListenerItem";
Expand Down
2 changes: 1 addition & 1 deletion src/tree/models.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Resource, WebPubSubHub, WebPubSubResource } from "@azure/arm-webpubsub";
import { type Resource, type WebPubSubHub, type WebPubSubResource } from "@azure/arm-webpubsub";
import { getResourceGroupFromId } from "@microsoft/vscode-azext-azureutils";
import { nonNullProp } from "@microsoft/vscode-azext-utils";

Expand Down
5 changes: 3 additions & 2 deletions src/tree/pickitem/pickSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AzureWizard, QuickPickAzureSubscriptionStep, TreeElementBase, type IActionContext } from "@microsoft/vscode-azext-utils";
import { AzureResourceBranchDataProvider, AzureSubscription } from "@microsoft/vscode-azureresources-api";
import { type TreeElementBase} from "@microsoft/vscode-azext-utils";
import { AzureWizard, QuickPickAzureSubscriptionStep, type IActionContext } from "@microsoft/vscode-azext-utils";
import { type AzureResourceBranchDataProvider, type AzureSubscription } from "@microsoft/vscode-azureresources-api";

// Modified from function subscriptionExperience(context, tdp)

Expand Down
10 changes: 6 additions & 4 deletions src/tree/service/ServiceItem.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { KnownServiceKind, WebPubSubResource } from "@azure/arm-webpubsub";
import { type WebPubSubResource } from "@azure/arm-webpubsub";
import { KnownServiceKind } from "@azure/arm-webpubsub";
import { getResourceGroupFromId, uiUtils } from "@microsoft/vscode-azext-azureutils";
import { IActionContext, TreeElementBase, TreeItemIconPath, createContextValue, createSubscriptionContext } from "@microsoft/vscode-azext-utils";
import { AzureResource, AzureSubscription, ViewPropertiesModel } from '@microsoft/vscode-azureresources-api';
import { type IActionContext, type TreeElementBase, type TreeItemIconPath} from "@microsoft/vscode-azext-utils";
import { createContextValue, createSubscriptionContext } from "@microsoft/vscode-azext-utils";
import { type AzureResource, type AzureSubscription, type ViewPropertiesModel } from '@microsoft/vscode-azureresources-api';
import * as vscode from 'vscode';
import { createWebPubSubHubsAPIClient } from "../../utils";
import { HubsItem } from "../hub/HubsItem";
import { WebPubSubModel } from "../models";
import { type WebPubSubModel } from "../models";
import { treeUtils } from "../treeUtils";
import { ServicePropertiesItem } from "./ServicePropertiesItem";

Expand Down
10 changes: 6 additions & 4 deletions src/tree/service/ServicePropertiesItem.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { KnownWebPubSubSkuTier, ProvisioningState } from "@azure/arm-webpubsub";
import { TreeElementBase, TreeItemIconPath, createContextValue, createGenericElement } from "@microsoft/vscode-azext-utils";
import { ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import { type ProvisioningState } from "@azure/arm-webpubsub";
import { KnownWebPubSubSkuTier } from "@azure/arm-webpubsub";
import { type TreeElementBase, type TreeItemIconPath} from "@microsoft/vscode-azext-utils";
import { createContextValue, createGenericElement } from "@microsoft/vscode-azext-utils";
import { type ViewPropertiesModel } from "@microsoft/vscode-azureresources-api";
import * as vscode from 'vscode';
import { ThemeIcon } from "vscode";
import { localize } from "../../utils";
import { WebPubSubModel } from "../models";
import { type WebPubSubModel } from "../models";


export class ServicePropertiesItem implements TreeElementBase {
Expand Down
2 changes: 1 addition & 1 deletion src/tree/treeUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TreeElementBase, TreeItemIconPath } from "@microsoft/vscode-azext-utils";
import { type TreeElementBase, type TreeItemIconPath } from "@microsoft/vscode-azext-utils";
import * as vscode from 'vscode';
import { ext } from "../../extension.bundle";

Expand Down
11 changes: 7 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@

// tslint:disable-next-line:no-require-imports no-implicit-dependencies
import { WebPubSubManagementClient } from "@azure/arm-webpubsub";
import { AzExtClientContext, OpenInPortalOptions, createAzureClient } from "@microsoft/vscode-azext-azureutils";
import { ExecuteActivityContext, IActionContext, IGenericTreeItemOptions, TreeItemIconPath, createSubscriptionContext } from "@microsoft/vscode-azext-utils";
import { type AzExtClientContext, type OpenInPortalOptions} from "@microsoft/vscode-azext-azureutils";
import { createAzureClient } from "@microsoft/vscode-azext-azureutils";
import { type ExecuteActivityContext, type IActionContext, type IGenericTreeItemOptions, type TreeItemIconPath} from "@microsoft/vscode-azext-utils";
import { createSubscriptionContext } from "@microsoft/vscode-azext-utils";
import { type AzureResourcesExtensionApiWithActivity } from "@microsoft/vscode-azext-utils/activity";
import { AzureSubscription } from "@microsoft/vscode-azureresources-api";
import { type AzureSubscription } from "@microsoft/vscode-azureresources-api";
import * as fs from "fs";
import * as path from 'path';
import * as vscode from 'vscode';
import { ConfigurationTarget, ExtensionContext, ProgressLocation, Uri, WorkspaceConfiguration, WorkspaceFolder, window, workspace } from 'vscode';
import { type ExtensionContext, type WorkspaceConfiguration, type WorkspaceFolder} from 'vscode';
import { ConfigurationTarget, ProgressLocation, Uri, window, workspace } from 'vscode';
import * as nls from 'vscode-nls';
import { settingsFile, vscodeFolder } from "./constants";
import { ext } from "./extensionVariables";
Expand Down
6 changes: 3 additions & 3 deletions src/workflows/common/contexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AggregationType } from "@azure/arm-monitor";
import { EventHandler, KeyType } from "@azure/arm-webpubsub";
import { ExecuteActivityContext, IActionContext, ISubscriptionContext } from "@microsoft/vscode-azext-utils";
import { type AggregationType } from "@azure/arm-monitor";
import { type EventHandler, type KeyType } from "@azure/arm-webpubsub";
import { type ExecuteActivityContext, type IActionContext, type ISubscriptionContext } from "@microsoft/vscode-azext-utils";


export interface IPickServiceContext extends IActionContext, ExecuteActivityContext {
Expand Down
8 changes: 5 additions & 3 deletions src/workflows/common/getKeyTypeStep.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { KeyType, KnownKeyType } from "@azure/arm-webpubsub";
import { AzureWizardPromptStep, IAzureQuickPickItem } from "@microsoft/vscode-azext-utils";
import { type KeyType} from "@azure/arm-webpubsub";
import { KnownKeyType } from "@azure/arm-webpubsub";
import { type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils";
import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils";
import { localize } from "../../utils";
import { IPickKeyContext } from "./contexts";
import { type IPickKeyContext } from "./contexts";

const keyTypePickItems: IAzureQuickPickItem<KeyType>[] = [
{ label: "Primary", data: KnownKeyType.Primary },
Expand Down
11 changes: 7 additions & 4 deletions src/workflows/hub/update/HubSettingFileSystem.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { WebPubSubHubProperties, WebPubSubManagementClient } from "@azure/arm-webpubsub";
import { type WebPubSubHubProperties} from "@azure/arm-webpubsub";
import { WebPubSubManagementClient } from "@azure/arm-webpubsub";
import { createAzureClient } from "@microsoft/vscode-azext-azureutils";
import { ext } from "@microsoft/vscode-azext-github";
import { AzExtTreeFileSystem, AzExtTreeFileSystemItem, IActionContext, createSubscriptionContext } from "@microsoft/vscode-azext-utils";
import { AzureSubscription } from "@microsoft/vscode-azureresources-api";
import { type AzExtTreeFileSystemItem, type IActionContext} from "@microsoft/vscode-azext-utils";
import { AzExtTreeFileSystem, createSubscriptionContext } from "@microsoft/vscode-azext-utils";
import { type AzureSubscription } from "@microsoft/vscode-azureresources-api";
import * as jsonc from 'jsonc-parser';
import * as os from "os";
import { Diagnostic, DiagnosticSeverity, FileStat, FileType, MessageItem, Uri, commands, languages, window } from "vscode";
import { type Diagnostic, type FileStat, type MessageItem, type Uri} from "vscode";
import { DiagnosticSeverity, FileType, commands, languages, window } from "vscode";
import { localize } from "../../../utils";

const insertKeyHere: string = localize('insertTagName', '<Insert tag name>');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { WebPubSubManagementClient } from "@azure/arm-webpubsub";
import { type WebPubSubManagementClient } from "@azure/arm-webpubsub";
import { AzureWizardExecuteStep } from "@microsoft/vscode-azext-utils";
import { Progress } from "vscode";
import { type Progress } from "vscode";
import { localize, nonNullProp } from "../../../utils";
import { ICreateOrUpdateHubSettingContext } from "../create/ICreateEventHandlerContext";
import { type ICreateOrUpdateHubSettingContext } from "../create/ICreateEventHandlerContext";

export class CreateOrUpdateHubSettingStep extends AzureWizardExecuteStep<ICreateOrUpdateHubSettingContext> {
public priority: number = 135;
Expand All @@ -19,7 +19,7 @@ export class CreateOrUpdateHubSettingStep extends AzureWizardExecuteStep<ICreate
progress.report({ message });
if (!context.hubProperties) throw new Error("hubProperties is null");

var hubProperties = context.hubProperties;
const hubProperties = context.hubProperties;
if (!hubProperties.eventHandlers) hubProperties.eventHandlers = [];
if (!hubProperties.eventListeners) hubProperties.eventListeners = [];

Expand Down
4 changes: 2 additions & 2 deletions src/workflows/hubSetting/common/IUpdateEventHandlerContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventHandler } from "@azure/arm-webpubsub";
import { ExecuteActivityContext, IActionContext } from "@microsoft/vscode-azext-utils";
import { type EventHandler } from "@azure/arm-webpubsub";
import { type ExecuteActivityContext, type IActionContext } from "@microsoft/vscode-azext-utils";


export interface IUpdateEventHandlerContext extends IActionContext, ExecuteActivityContext {
Expand Down
4 changes: 2 additions & 2 deletions src/workflows/hubSetting/create/ICreateEventHandlerContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { WebPubSubHubProperties } from "@azure/arm-webpubsub";
import { IPickServiceContext } from "src/workflows/common/contexts";
import { type WebPubSubHubProperties } from "@azure/arm-webpubsub";
import { type IPickServiceContext } from "src/workflows/common/contexts";

export interface ICreateOrUpdateHubSettingContext extends IPickServiceContext {
hubName?: string;
Expand Down
Loading

0 comments on commit d42e714

Please sign in to comment.