diff --git a/extensions/.eslintrc.json b/extensions/.eslintrc.json index c3593ec33a..d318e47f29 100644 --- a/extensions/.eslintrc.json +++ b/extensions/.eslintrc.json @@ -3,6 +3,7 @@ "no-cond-assign": 2, "jsdoc/check-param-names": "error", "@typescript-eslint/explicit-function-return-type": ["error"], - "@typescript-eslint/await-thenable": ["error"] + "@typescript-eslint/await-thenable": ["error"], + "@typescript-eslint/no-unsafe-assignment": "error" } } diff --git a/extensions/admin-tool-ext-win/.eslintrc.json b/extensions/admin-tool-ext-win/.eslintrc.json index 335698d7da..4580d5ee2d 100644 --- a/extensions/admin-tool-ext-win/.eslintrc.json +++ b/extensions/admin-tool-ext-win/.eslintrc.json @@ -8,6 +8,7 @@ { "ignoreVoid": true } - ] + ], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/agent/.eslintrc.json b/extensions/agent/.eslintrc.json index 5a2aa1163b..3a90f89f72 100644 --- a/extensions/agent/.eslintrc.json +++ b/extensions/agent/.eslintrc.json @@ -5,6 +5,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/arc/.eslintrc.json b/extensions/arc/.eslintrc.json index 2c3f44e6aa..cc239db0d9 100644 --- a/extensions/arc/.eslintrc.json +++ b/extensions/arc/.eslintrc.json @@ -5,6 +5,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/azuremonitor/.eslintrc.json b/extensions/azuremonitor/.eslintrc.json index bda0c69bb1..8010acc5e5 100644 --- a/extensions/azuremonitor/.eslintrc.json +++ b/extensions/azuremonitor/.eslintrc.json @@ -5,6 +5,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/cms/.eslintrc.json b/extensions/cms/.eslintrc.json index 44c6eb979a..7ad22ac5d2 100644 --- a/extensions/cms/.eslintrc.json +++ b/extensions/cms/.eslintrc.json @@ -4,6 +4,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/configuration-editing/.eslintrc.json b/extensions/configuration-editing/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/configuration-editing/.eslintrc.json +++ b/extensions/configuration-editing/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/css-language-features/.eslintrc.json b/extensions/css-language-features/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/css-language-features/.eslintrc.json +++ b/extensions/css-language-features/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/dacpac/.eslintrc.json b/extensions/dacpac/.eslintrc.json index 1e9e4fa12e..be715225bf 100644 --- a/extensions/dacpac/.eslintrc.json +++ b/extensions/dacpac/.eslintrc.json @@ -5,6 +5,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/data-workspace/.eslintrc.json b/extensions/data-workspace/.eslintrc.json index f6a6a84c13..765bbe58a5 100644 --- a/extensions/data-workspace/.eslintrc.json +++ b/extensions/data-workspace/.eslintrc.json @@ -11,6 +11,7 @@ } ], // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/datavirtualization/.eslintrc.json b/extensions/datavirtualization/.eslintrc.json index 56c46b4157..ef4a85a07c 100644 --- a/extensions/datavirtualization/.eslintrc.json +++ b/extensions/datavirtualization/.eslintrc.json @@ -4,6 +4,7 @@ "createDefaultProgram": true }, "rules": { - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/git-base/.eslintrc.json b/extensions/git-base/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/git-base/.eslintrc.json +++ b/extensions/git-base/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/git/.eslintrc.json b/extensions/git/.eslintrc.json index 893b221f9c..c84006f88b 100644 --- a/extensions/git/.eslintrc.json +++ b/extensions/git/.eslintrc.json @@ -2,6 +2,7 @@ "rules": { "no-cond-assign": 0, "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/github-authentication/.eslintrc.json b/extensions/github-authentication/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/github-authentication/.eslintrc.json +++ b/extensions/github-authentication/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/github/.eslintrc.json b/extensions/github/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/github/.eslintrc.json +++ b/extensions/github/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/html-language-features/.eslintrc.json b/extensions/html-language-features/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/html-language-features/.eslintrc.json +++ b/extensions/html-language-features/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/image-preview/.eslintrc.json b/extensions/image-preview/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/image-preview/.eslintrc.json +++ b/extensions/image-preview/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/import/.eslintrc.json b/extensions/import/.eslintrc.json index 7c75ec099f..8ec223127c 100644 --- a/extensions/import/.eslintrc.json +++ b/extensions/import/.eslintrc.json @@ -4,6 +4,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/integration-tests/.eslintrc.json b/extensions/integration-tests/.eslintrc.json index 5808ee6dcb..d9c806b3dd 100644 --- a/extensions/integration-tests/.eslintrc.json +++ b/extensions/integration-tests/.eslintrc.json @@ -5,6 +5,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/ipynb/.eslintrc.json b/extensions/ipynb/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/ipynb/.eslintrc.json +++ b/extensions/ipynb/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/json-language-features/.eslintrc.json b/extensions/json-language-features/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/json-language-features/.eslintrc.json +++ b/extensions/json-language-features/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/kusto/.eslintrc.json b/extensions/kusto/.eslintrc.json index 927c139190..6f88abb7b7 100644 --- a/extensions/kusto/.eslintrc.json +++ b/extensions/kusto/.eslintrc.json @@ -5,6 +5,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/machine-learning/.eslintrc.json b/extensions/machine-learning/.eslintrc.json new file mode 100644 index 0000000000..3090ce9b97 --- /dev/null +++ b/extensions/machine-learning/.eslintrc.json @@ -0,0 +1,9 @@ +{ + "parserOptions": { + "project": "./extensions/machine-learning/tsconfig.json" + }, + "rules": { + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" + } +} diff --git a/extensions/machine-learning/src/.eslintrc.json b/extensions/machine-learning/src/.eslintrc.json deleted file mode 100644 index 714eb58da7..0000000000 --- a/extensions/machine-learning/src/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parserOptions": { - "project": "./extensions/machine-learning/tsconfig.json" - }, - "rules": { - "@typescript-eslint/explicit-function-return-type": ["off"] - } -} diff --git a/extensions/markdown-language-features/.eslintrc.json b/extensions/markdown-language-features/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/markdown-language-features/.eslintrc.json +++ b/extensions/markdown-language-features/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/markdown-math/.eslintrc.json b/extensions/markdown-math/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/markdown-math/.eslintrc.json +++ b/extensions/markdown-math/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/merge-conflict/.eslintrc.json b/extensions/merge-conflict/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/merge-conflict/.eslintrc.json +++ b/extensions/merge-conflict/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/microsoft-authentication/.eslintrc.json b/extensions/microsoft-authentication/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/microsoft-authentication/.eslintrc.json +++ b/extensions/microsoft-authentication/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/mssql/package.json b/extensions/mssql/package.json index 8923e007eb..8254fb23ed 100644 --- a/extensions/mssql/package.json +++ b/extensions/mssql/package.json @@ -32,6 +32,10 @@ } ], "commands": [ + { + "command": "objectExplorer.scriptAsAlter", + "title": "Script as Alter" + }, { "command": "mssql.exportSqlAsNotebook", "title": "%mssql.exportSqlAsNotebook%" @@ -491,6 +495,11 @@ } ], "objectExplorer/item/context": [ + { + "command": "objectExplorer.scriptAsAlter", + "when": "nodeType == Table", + "group": "0_query@5" + }, { "command": "mssql.designTable", "when": "connectionProvider == MSSQL && nodeType == Table && nodeSubType != LedgerDropped", diff --git a/extensions/mssql/src/contextProvider.ts b/extensions/mssql/src/contextProvider.ts index cf6007fc02..c09b66e2e0 100644 --- a/extensions/mssql/src/contextProvider.ts +++ b/extensions/mssql/src/contextProvider.ts @@ -60,6 +60,7 @@ export default class ContextProvider { } dispose(): void { - this._disposables = this._disposables.map(i => i.dispose()); + this._disposables.forEach(i => i.dispose()); + this._disposables = []; } } diff --git a/extensions/mssql/src/credentialstore/credentialstore.ts b/extensions/mssql/src/credentialstore/credentialstore.ts index 76237767a2..6f8c74cfce 100644 --- a/extensions/mssql/src/credentialstore/credentialstore.ts +++ b/extensions/mssql/src/credentialstore/credentialstore.ts @@ -26,7 +26,7 @@ export class CredentialStore { baseConfig: IConfig ) { if (baseConfig) { - this._config = JSON.parse(JSON.stringify(baseConfig)); + this._config = JSON.parse(JSON.stringify(baseConfig)) as IConfig; this._config.executableFiles = ['MicrosoftSqlToolsCredentials.exe', 'MicrosoftSqlToolsCredentials']; } this.context = context; diff --git a/extensions/mssql/src/dashboard/bookExtensions.ts b/extensions/mssql/src/dashboard/bookExtensions.ts index d5bb905112..5ed209296e 100644 --- a/extensions/mssql/src/dashboard/bookExtensions.ts +++ b/extensions/mssql/src/dashboard/bookExtensions.ts @@ -56,7 +56,7 @@ namespace BookContributions { export function fromExtension( extension: vscode.Extension ): BookContribution[] { - const contributions = extension.packageJSON && extension.packageJSON.contributes; + const contributions = extension.packageJSON?.contributes as unknown[]; if (!contributions) { return []; } diff --git a/extensions/mssql/src/features.ts b/extensions/mssql/src/features.ts index 4dfa955fa1..eec1ebcb31 100644 --- a/extensions/mssql/src/features.ts +++ b/extensions/mssql/src/features.ts @@ -107,14 +107,14 @@ export class AccountFeature implements StaticFeature { // find account const accountList = await azdata.accounts.getAllAccounts(); - const account = accountList.find(a => a.key.accountId === request.accountId); + const account: azurecore.AzureAccount | undefined = accountList.find(a => a.key.accountId === request.accountId); if (!account) { console.log(`Failed to find azure account ${request.accountId} when executing token refresh`); throw Error(localizedConstants.failedToFindAccount(request.accountId)); } // find tenant - const tenant = account.properties.tenants.find((tenant: any) => tenant.id === request.tenantId); + const tenant = account.properties.tenants.find(tenant => tenant.id === request.tenantId); if (!tenant) { console.log(`Failed to find tenant ${request.tenantId} in account ${account.displayInfo.displayName} when refreshing security token`); throw Error(localizedConstants.failedToFindTenants(request.tenantId, account.displayInfo.displayName)); diff --git a/extensions/mssql/src/objectManagement/ui/principalDialogBase.ts b/extensions/mssql/src/objectManagement/ui/principalDialogBase.ts index 1010e95a74..4750b2d66a 100644 --- a/extensions/mssql/src/objectManagement/ui/principalDialogBase.ts +++ b/extensions/mssql/src/objectManagement/ui/principalDialogBase.ts @@ -81,7 +81,7 @@ export abstract class PrincipalDialogBase { - const permissionName = this.permissionTable.data[arg.row][0]; + const permissionName = this.permissionTable.data[arg.row][0] as string; const securable = this.securablePermissions[this.securableTable.selectedRows[0]]; let permission: SecurablePermissionItem = securable.permissions.find(securablePermission => securablePermission.permission === permissionName); if (!permission) { diff --git a/extensions/mssql/src/resourceProvider/resourceProvider.ts b/extensions/mssql/src/resourceProvider/resourceProvider.ts index f563ee2049..ae380ffa7c 100644 --- a/extensions/mssql/src/resourceProvider/resourceProvider.ts +++ b/extensions/mssql/src/resourceProvider/resourceProvider.ts @@ -77,7 +77,7 @@ export class AzureResourceProvider { constructor(private logPath: string, baseConfig: IConfig) { if (baseConfig) { - this._config = JSON.parse(JSON.stringify(baseConfig)); + this._config = JSON.parse(JSON.stringify(baseConfig)) as IConfig; this._config.executableFiles = ['SqlToolsResourceProviderService.exe', 'SqlToolsResourceProviderService']; } } diff --git a/extensions/mssql/src/sqlNotebook/sqlNotebookController.ts b/extensions/mssql/src/sqlNotebook/sqlNotebookController.ts index b6b9af7e6f..1cb78f6a00 100644 --- a/extensions/mssql/src/sqlNotebook/sqlNotebookController.ts +++ b/extensions/mssql/src/sqlNotebook/sqlNotebookController.ts @@ -41,7 +41,7 @@ export class SqlNotebookController implements vscode.Disposable { this._controller.supportedLanguages = ['sql']; this._controller.supportsExecutionOrder = true; - this._controller.executeHandler = this.execute.bind(this); + this._controller.executeHandler = this.execute.bind(this) as (cells: vscode.NotebookCell[], notebook: vscode.NotebookDocument, controller: vscode.NotebookController) => void | Thenable; const sqlProvider = 'MSSQL'; this._queryProvider = azdata.dataprotocol.getProvider(sqlProvider, azdata.DataProviderType.QueryProvider); @@ -105,13 +105,13 @@ export class SqlNotebookController implements vscode.Disposable { public getConnectionProfile(connection: azdata.connection.Connection): azdata.IConnectionProfile { let connectionProfile: azdata.IConnectionProfile = { - connectionName: connection.options.connectionName, - serverName: connection.options.server, - databaseName: connection.options.database, - userName: connection.options.user, - password: connection.options.password, - authenticationType: connection.options.authenticationType, - savePassword: connection.options.savePassword, + connectionName: connection.options.connectionName as string, + serverName: connection.options.server as string, + databaseName: connection.options.database as string, + userName: connection.options.user as string, + password: connection.options.password as string, + authenticationType: connection.options.authenticationType as string, + savePassword: connection.options.savePassword as boolean, groupFullName: undefined, groupId: undefined, providerName: connection.providerName, diff --git a/extensions/mssql/src/sqlToolsServer.ts b/extensions/mssql/src/sqlToolsServer.ts index 40463258b6..1a185080a7 100644 --- a/extensions/mssql/src/sqlToolsServer.ts +++ b/extensions/mssql/src/sqlToolsServer.ts @@ -132,7 +132,7 @@ export class SqlToolsServer { private async download(context: AppContext): Promise { const configDir = context.extensionContext.extensionPath; const rawConfig = await fs.readFile(path.join(configDir, 'config.json')); - this.config = JSON.parse(rawConfig.toString()); + this.config = JSON.parse(rawConfig.toString()) as IConfig; this.config.installDirectory = path.join(configDir, this.config.installDirectory); this.config.proxy = vscode.workspace.getConfiguration('http').get('proxy', ''); this.config.strictSSL = vscode.workspace.getConfiguration('http').get('proxyStrictSSL', true); diff --git a/extensions/mssql/src/tableDesigner/tableDesigner.ts b/extensions/mssql/src/tableDesigner/tableDesigner.ts index 7d639d1905..b955651ac2 100644 --- a/extensions/mssql/src/tableDesigner/tableDesigner.ts +++ b/extensions/mssql/src/tableDesigner/tableDesigner.ts @@ -36,7 +36,7 @@ export function registerTableDesignerCommands(appContext: AppContext) { isNewTable: true, id: generateUuid(), connectionString: connectionString, - accessToken: context.connectionProfile!.options.azureAccountToken, + accessToken: context.connectionProfile!.options.azureAccountToken as string, tableIcon: tableIcon }, telemetryInfo, context); } catch (error) { @@ -68,7 +68,7 @@ export function registerTableDesignerCommands(appContext: AppContext) { schema: schema, id: `${sqlProviderName}|${server}|${database}|${schema}|${name}`, connectionString: connectionString, - accessToken: context.connectionProfile!.options.azureAccountToken, + accessToken: context.connectionProfile!.options.azureAccountToken as string, tableIcon: tableIcon }, telemetryInfo, context); } catch (error) { diff --git a/extensions/mssql/src/telemetry.ts b/extensions/mssql/src/telemetry.ts index 6b38aa1c99..b7daa1fc4f 100644 --- a/extensions/mssql/src/telemetry.ts +++ b/extensions/mssql/src/telemetry.ts @@ -11,11 +11,16 @@ import * as Constants from './constants'; import * as nls from 'vscode-nls'; import { ServerInfo } from 'azdata'; +interface IPackageInfo { + name: string; + version: string; + aiKey: string; +} const localize = nls.loadMessageBundle(); const viewKnownIssuesAction = localize('viewKnownIssuesText', "View Known Issues"); -const packageInfo = vscode.extensions.getExtension(Constants.packageName)?.packageJSON; +const packageInfo = vscode.extensions.getExtension(Constants.packageName)?.packageJSON as IPackageInfo | undefined; export const TelemetryReporter = new AdsTelemetryReporter(packageInfo?.name, packageInfo?.version, packageInfo?.aiKey); /** diff --git a/extensions/mssql/src/util/objects.ts b/extensions/mssql/src/util/objects.ts index b49f7240aa..b302cdfa3b 100644 --- a/extensions/mssql/src/util/objects.ts +++ b/extensions/mssql/src/util/objects.ts @@ -80,9 +80,9 @@ export function deepClone(obj: T): T { const result: any = Array.isArray(obj) ? [] : {}; Object.keys(obj).forEach((key: string) => { if ((obj)[key] && typeof (obj)[key] === 'object') { - result[key] = deepClone((obj)[key]); + result[key] = deepClone((obj)[key]) as unknown; } else { - result[key] = (obj)[key]; + result[key] = (obj)[key] as unknown; } }); return result; diff --git a/extensions/mssql/src/utils.ts b/extensions/mssql/src/utils.ts index 62109f45c8..ae9d729930 100644 --- a/extensions/mssql/src/utils.ts +++ b/extensions/mssql/src/utils.ts @@ -205,7 +205,7 @@ export function getCommonLaunchArgsAndCleanupOldLogFiles(logPath: string, fileNa export function ensure(target: { [key: string]: any }, key: string): any { if (target[key] === void 0) { - target[key] = {} as any; + target[key] = {}; } return target[key]; } @@ -223,7 +223,7 @@ export function getErrorMessage(error: Error | any, removeHeader: boolean = fals if (error instanceof Error) { errorMessage = error.message; } else if (error.responseText) { - errorMessage = error.responseText; + errorMessage = error.responseText as string; if (error.status) { errorMessage += ` (${error.status})`; } @@ -265,9 +265,9 @@ export function isValidNumber(maybeNumber: any) { * Helper to log messages to the developer console if enabled * @param msg Message to log to the console */ -export function logDebug(msg: any): void { +export function logDebug(msg: unknown): void { let config = vscode.workspace.getConfiguration(extensionConfigSectionName); - let logDebugInfo = config[configLogDebugInfo]; + let logDebugInfo = !!config[configLogDebugInfo]; if (logDebugInfo === true) { let currentTime = new Date().toLocaleTimeString(); let outputMsg = '[' + currentTime + ']: ' + msg ? msg.toString() : ''; diff --git a/extensions/notebook-renderers/.eslintrc.json b/extensions/notebook-renderers/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/notebook-renderers/.eslintrc.json +++ b/extensions/notebook-renderers/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/notebook/.eslintrc.json b/extensions/notebook/.eslintrc.json index 15985e24b0..ccfeacf94c 100644 --- a/extensions/notebook/.eslintrc.json +++ b/extensions/notebook/.eslintrc.json @@ -11,6 +11,7 @@ } ], // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/profiler/.eslintrc.json b/extensions/profiler/.eslintrc.json index 319d28bff2..a1d9db2a20 100644 --- a/extensions/profiler/.eslintrc.json +++ b/extensions/profiler/.eslintrc.json @@ -4,6 +4,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/query-history/.eslintrc.json b/extensions/query-history/.eslintrc.json index 32b2c64de3..b25fc3bd17 100644 --- a/extensions/query-history/.eslintrc.json +++ b/extensions/query-history/.eslintrc.json @@ -8,6 +8,7 @@ { "ignoreVoid": true } - ] + ], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/resource-deployment/.eslintrc.json b/extensions/resource-deployment/.eslintrc.json index 2cf7802e3f..0d7018af02 100644 --- a/extensions/resource-deployment/.eslintrc.json +++ b/extensions/resource-deployment/.eslintrc.json @@ -5,6 +5,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/schema-compare/.eslintrc.json b/extensions/schema-compare/.eslintrc.json index 46c0f114b2..11b35a8603 100644 --- a/extensions/schema-compare/.eslintrc.json +++ b/extensions/schema-compare/.eslintrc.json @@ -4,6 +4,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/search-result/.eslintrc.json b/extensions/search-result/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/search-result/.eslintrc.json +++ b/extensions/search-result/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/server-report/.eslintrc.json b/extensions/server-report/.eslintrc.json index 5fd96d9a97..325781713c 100644 --- a/extensions/server-report/.eslintrc.json +++ b/extensions/server-report/.eslintrc.json @@ -1,5 +1,8 @@ { "parserOptions": { "project": "./extensions/server-report/tsconfig.json" + }, + "rules": { + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/simple-browser/.eslintrc.json b/extensions/simple-browser/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/simple-browser/.eslintrc.json +++ b/extensions/simple-browser/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/sql-assessment/.eslintrc.json b/extensions/sql-assessment/.eslintrc.json index 55dfd7a96c..4ed7f267b3 100644 --- a/extensions/sql-assessment/.eslintrc.json +++ b/extensions/sql-assessment/.eslintrc.json @@ -4,6 +4,7 @@ }, "rules": { // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/sql-bindings/.eslintrc.json b/extensions/sql-bindings/.eslintrc.json index edbc8cfea5..7964af9213 100644 --- a/extensions/sql-bindings/.eslintrc.json +++ b/extensions/sql-bindings/.eslintrc.json @@ -9,6 +9,7 @@ "ignoreVoid": true } ], - "jsdoc/require-param": "error" + "jsdoc/require-param": "error", + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/sql-database-projects/.eslintrc.json b/extensions/sql-database-projects/.eslintrc.json index dc1af000e8..90b976b69a 100644 --- a/extensions/sql-database-projects/.eslintrc.json +++ b/extensions/sql-database-projects/.eslintrc.json @@ -10,6 +10,7 @@ } ], // Disabled until the issues can be fixed - "@typescript-eslint/explicit-function-return-type": ["off"] + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/sql-migration/.eslintrc.json b/extensions/sql-migration/.eslintrc.json index 98fe0ce7b1..48c8d618f1 100644 --- a/extensions/sql-migration/.eslintrc.json +++ b/extensions/sql-migration/.eslintrc.json @@ -5,6 +5,7 @@ "rules": { // Disabled until the issues can be fixed "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/no-async-promise-executor": ["off"] + "@typescript-eslint/no-async-promise-executor": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/typescript-language-features/.eslintrc.json b/extensions/typescript-language-features/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/typescript-language-features/.eslintrc.json +++ b/extensions/typescript-language-features/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/vscode-api-tests/.eslintrc.json b/extensions/vscode-api-tests/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/vscode-api-tests/.eslintrc.json +++ b/extensions/vscode-api-tests/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/vscode-test-resolver/.eslintrc.json b/extensions/vscode-test-resolver/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/vscode-test-resolver/.eslintrc.json +++ b/extensions/vscode-test-resolver/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } } diff --git a/extensions/xml-language-features/.eslintrc.json b/extensions/xml-language-features/.eslintrc.json index 0b87813c38..ce28ab7a81 100644 --- a/extensions/xml-language-features/.eslintrc.json +++ b/extensions/xml-language-features/.eslintrc.json @@ -1,6 +1,7 @@ { "rules": { "@typescript-eslint/explicit-function-return-type": ["off"], - "@typescript-eslint/await-thenable": ["off"] + "@typescript-eslint/await-thenable": ["off"], + "@typescript-eslint/no-unsafe-assignment": "off" } }