Enable no-unsafe-assignments for MSSQL (#23407)
* Enable no-unsafe-assignments for MSSQL * Remove toString
This commit is contained in:
Родитель
1bed054668
Коммит
cdece24123
|
@ -3,6 +3,7 @@
|
||||||
"no-cond-assign": 2,
|
"no-cond-assign": 2,
|
||||||
"jsdoc/check-param-names": "error",
|
"jsdoc/check-param-names": "error",
|
||||||
"@typescript-eslint/explicit-function-return-type": ["error"],
|
"@typescript-eslint/explicit-function-return-type": ["error"],
|
||||||
"@typescript-eslint/await-thenable": ["error"]
|
"@typescript-eslint/await-thenable": ["error"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
{
|
{
|
||||||
"ignoreVoid": true
|
"ignoreVoid": true
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"createDefaultProgram": true
|
"createDefaultProgram": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"]
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-cond-assign": 0,
|
"no-cond-assign": 0,
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./extensions/machine-learning/tsconfig.json"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commands": [
|
"commands": [
|
||||||
|
{
|
||||||
|
"command": "objectExplorer.scriptAsAlter",
|
||||||
|
"title": "Script as Alter"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "mssql.exportSqlAsNotebook",
|
"command": "mssql.exportSqlAsNotebook",
|
||||||
"title": "%mssql.exportSqlAsNotebook%"
|
"title": "%mssql.exportSqlAsNotebook%"
|
||||||
|
@ -491,6 +495,11 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"objectExplorer/item/context": [
|
"objectExplorer/item/context": [
|
||||||
|
{
|
||||||
|
"command": "objectExplorer.scriptAsAlter",
|
||||||
|
"when": "nodeType == Table",
|
||||||
|
"group": "0_query@5"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "mssql.designTable",
|
"command": "mssql.designTable",
|
||||||
"when": "connectionProvider == MSSQL && nodeType == Table && nodeSubType != LedgerDropped",
|
"when": "connectionProvider == MSSQL && nodeType == Table && nodeSubType != LedgerDropped",
|
||||||
|
|
|
@ -60,6 +60,7 @@ export default class ContextProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose(): void {
|
dispose(): void {
|
||||||
this._disposables = this._disposables.map(i => i.dispose());
|
this._disposables.forEach(i => i.dispose());
|
||||||
|
this._disposables = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ export class CredentialStore {
|
||||||
baseConfig: IConfig
|
baseConfig: IConfig
|
||||||
) {
|
) {
|
||||||
if (baseConfig) {
|
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._config.executableFiles = ['MicrosoftSqlToolsCredentials.exe', 'MicrosoftSqlToolsCredentials'];
|
||||||
}
|
}
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace BookContributions {
|
||||||
export function fromExtension(
|
export function fromExtension(
|
||||||
extension: vscode.Extension<any>
|
extension: vscode.Extension<any>
|
||||||
): BookContribution[] {
|
): BookContribution[] {
|
||||||
const contributions = extension.packageJSON && extension.packageJSON.contributes;
|
const contributions = extension.packageJSON?.contributes as unknown[];
|
||||||
if (!contributions) {
|
if (!contributions) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,14 +107,14 @@ export class AccountFeature implements StaticFeature {
|
||||||
|
|
||||||
// find account
|
// find account
|
||||||
const accountList = await azdata.accounts.getAllAccounts();
|
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) {
|
if (!account) {
|
||||||
console.log(`Failed to find azure account ${request.accountId} when executing token refresh`);
|
console.log(`Failed to find azure account ${request.accountId} when executing token refresh`);
|
||||||
throw Error(localizedConstants.failedToFindAccount(request.accountId));
|
throw Error(localizedConstants.failedToFindAccount(request.accountId));
|
||||||
}
|
}
|
||||||
|
|
||||||
// find tenant
|
// 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) {
|
if (!tenant) {
|
||||||
console.log(`Failed to find tenant ${request.tenantId} in account ${account.displayInfo.displayName} when refreshing security token`);
|
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));
|
throw Error(localizedConstants.failedToFindTenants(request.tenantId, account.displayInfo.displayName));
|
||||||
|
|
|
@ -81,7 +81,7 @@ export abstract class PrincipalDialogBase<ObjectInfoType extends SecurityPrincip
|
||||||
width: DefaultTableWidth
|
width: DefaultTableWidth
|
||||||
}).component();
|
}).component();
|
||||||
this.disposables.push(this.permissionTable.onCellAction(async (arg: azdata.ICheckboxCellActionEventArgs) => {
|
this.disposables.push(this.permissionTable.onCellAction(async (arg: azdata.ICheckboxCellActionEventArgs) => {
|
||||||
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]];
|
const securable = this.securablePermissions[this.securableTable.selectedRows[0]];
|
||||||
let permission: SecurablePermissionItem = securable.permissions.find(securablePermission => securablePermission.permission === permissionName);
|
let permission: SecurablePermissionItem = securable.permissions.find(securablePermission => securablePermission.permission === permissionName);
|
||||||
if (!permission) {
|
if (!permission) {
|
||||||
|
|
|
@ -77,7 +77,7 @@ export class AzureResourceProvider {
|
||||||
|
|
||||||
constructor(private logPath: string, baseConfig: IConfig) {
|
constructor(private logPath: string, baseConfig: IConfig) {
|
||||||
if (baseConfig) {
|
if (baseConfig) {
|
||||||
this._config = JSON.parse(JSON.stringify(baseConfig));
|
this._config = JSON.parse(JSON.stringify(baseConfig)) as IConfig;
|
||||||
this._config.executableFiles = ['SqlToolsResourceProviderService.exe', 'SqlToolsResourceProviderService'];
|
this._config.executableFiles = ['SqlToolsResourceProviderService.exe', 'SqlToolsResourceProviderService'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ export class SqlNotebookController implements vscode.Disposable {
|
||||||
|
|
||||||
this._controller.supportedLanguages = ['sql'];
|
this._controller.supportedLanguages = ['sql'];
|
||||||
this._controller.supportsExecutionOrder = true;
|
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<void>;
|
||||||
|
|
||||||
const sqlProvider = 'MSSQL';
|
const sqlProvider = 'MSSQL';
|
||||||
this._queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>(sqlProvider, azdata.DataProviderType.QueryProvider);
|
this._queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>(sqlProvider, azdata.DataProviderType.QueryProvider);
|
||||||
|
@ -105,13 +105,13 @@ export class SqlNotebookController implements vscode.Disposable {
|
||||||
|
|
||||||
public getConnectionProfile(connection: azdata.connection.Connection): azdata.IConnectionProfile {
|
public getConnectionProfile(connection: azdata.connection.Connection): azdata.IConnectionProfile {
|
||||||
let connectionProfile: azdata.IConnectionProfile = {
|
let connectionProfile: azdata.IConnectionProfile = {
|
||||||
connectionName: connection.options.connectionName,
|
connectionName: connection.options.connectionName as string,
|
||||||
serverName: connection.options.server,
|
serverName: connection.options.server as string,
|
||||||
databaseName: connection.options.database,
|
databaseName: connection.options.database as string,
|
||||||
userName: connection.options.user,
|
userName: connection.options.user as string,
|
||||||
password: connection.options.password,
|
password: connection.options.password as string,
|
||||||
authenticationType: connection.options.authenticationType,
|
authenticationType: connection.options.authenticationType as string,
|
||||||
savePassword: connection.options.savePassword,
|
savePassword: connection.options.savePassword as boolean,
|
||||||
groupFullName: undefined,
|
groupFullName: undefined,
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
providerName: connection.providerName,
|
providerName: connection.providerName,
|
||||||
|
|
|
@ -132,7 +132,7 @@ export class SqlToolsServer {
|
||||||
private async download(context: AppContext): Promise<string> {
|
private async download(context: AppContext): Promise<string> {
|
||||||
const configDir = context.extensionContext.extensionPath;
|
const configDir = context.extensionContext.extensionPath;
|
||||||
const rawConfig = await fs.readFile(path.join(configDir, 'config.json'));
|
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.installDirectory = path.join(configDir, this.config.installDirectory);
|
||||||
this.config.proxy = vscode.workspace.getConfiguration('http').get<string>('proxy', '');
|
this.config.proxy = vscode.workspace.getConfiguration('http').get<string>('proxy', '');
|
||||||
this.config.strictSSL = vscode.workspace.getConfiguration('http').get('proxyStrictSSL', true);
|
this.config.strictSSL = vscode.workspace.getConfiguration('http').get('proxyStrictSSL', true);
|
||||||
|
|
|
@ -36,7 +36,7 @@ export function registerTableDesignerCommands(appContext: AppContext) {
|
||||||
isNewTable: true,
|
isNewTable: true,
|
||||||
id: generateUuid(),
|
id: generateUuid(),
|
||||||
connectionString: connectionString,
|
connectionString: connectionString,
|
||||||
accessToken: context.connectionProfile!.options.azureAccountToken,
|
accessToken: context.connectionProfile!.options.azureAccountToken as string,
|
||||||
tableIcon: tableIcon
|
tableIcon: tableIcon
|
||||||
}, telemetryInfo, context);
|
}, telemetryInfo, context);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -68,7 +68,7 @@ export function registerTableDesignerCommands(appContext: AppContext) {
|
||||||
schema: schema,
|
schema: schema,
|
||||||
id: `${sqlProviderName}|${server}|${database}|${schema}|${name}`,
|
id: `${sqlProviderName}|${server}|${database}|${schema}|${name}`,
|
||||||
connectionString: connectionString,
|
connectionString: connectionString,
|
||||||
accessToken: context.connectionProfile!.options.azureAccountToken,
|
accessToken: context.connectionProfile!.options.azureAccountToken as string,
|
||||||
tableIcon: tableIcon
|
tableIcon: tableIcon
|
||||||
}, telemetryInfo, context);
|
}, telemetryInfo, context);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -11,11 +11,16 @@ import * as Constants from './constants';
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
import { ServerInfo } from 'azdata';
|
import { ServerInfo } from 'azdata';
|
||||||
|
|
||||||
|
interface IPackageInfo {
|
||||||
|
name: string;
|
||||||
|
version: string;
|
||||||
|
aiKey: string;
|
||||||
|
}
|
||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
const viewKnownIssuesAction = localize('viewKnownIssuesText', "View Known Issues");
|
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<string, string>(packageInfo?.name, packageInfo?.version, packageInfo?.aiKey);
|
export const TelemetryReporter = new AdsTelemetryReporter<string, string>(packageInfo?.name, packageInfo?.version, packageInfo?.aiKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -80,9 +80,9 @@ export function deepClone<T>(obj: T): T {
|
||||||
const result: any = Array.isArray(obj) ? [] : {};
|
const result: any = Array.isArray(obj) ? [] : {};
|
||||||
Object.keys(<any>obj).forEach((key: string) => {
|
Object.keys(<any>obj).forEach((key: string) => {
|
||||||
if ((<any>obj)[key] && typeof (<any>obj)[key] === 'object') {
|
if ((<any>obj)[key] && typeof (<any>obj)[key] === 'object') {
|
||||||
result[key] = deepClone((<any>obj)[key]);
|
result[key] = deepClone((<any>obj)[key]) as unknown;
|
||||||
} else {
|
} else {
|
||||||
result[key] = (<any>obj)[key];
|
result[key] = (<any>obj)[key] as unknown;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -205,7 +205,7 @@ export function getCommonLaunchArgsAndCleanupOldLogFiles(logPath: string, fileNa
|
||||||
|
|
||||||
export function ensure(target: { [key: string]: any }, key: string): any {
|
export function ensure(target: { [key: string]: any }, key: string): any {
|
||||||
if (target[key] === void 0) {
|
if (target[key] === void 0) {
|
||||||
target[key] = {} as any;
|
target[key] = {};
|
||||||
}
|
}
|
||||||
return target[key];
|
return target[key];
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ export function getErrorMessage(error: Error | any, removeHeader: boolean = fals
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
errorMessage = error.message;
|
errorMessage = error.message;
|
||||||
} else if (error.responseText) {
|
} else if (error.responseText) {
|
||||||
errorMessage = error.responseText;
|
errorMessage = error.responseText as string;
|
||||||
if (error.status) {
|
if (error.status) {
|
||||||
errorMessage += ` (${error.status})`;
|
errorMessage += ` (${error.status})`;
|
||||||
}
|
}
|
||||||
|
@ -265,9 +265,9 @@ export function isValidNumber(maybeNumber: any) {
|
||||||
* Helper to log messages to the developer console if enabled
|
* Helper to log messages to the developer console if enabled
|
||||||
* @param msg Message to log to the console
|
* @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 config = vscode.workspace.getConfiguration(extensionConfigSectionName);
|
||||||
let logDebugInfo = config[configLogDebugInfo];
|
let logDebugInfo = !!config[configLogDebugInfo];
|
||||||
if (logDebugInfo === true) {
|
if (logDebugInfo === true) {
|
||||||
let currentTime = new Date().toLocaleTimeString();
|
let currentTime = new Date().toLocaleTimeString();
|
||||||
let outputMsg = '[' + currentTime + ']: ' + msg ? msg.toString() : '';
|
let outputMsg = '[' + currentTime + ']: ' + msg ? msg.toString() : '';
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
{
|
{
|
||||||
"ignoreVoid": true
|
"ignoreVoid": true
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
{
|
{
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"project": "./extensions/server-report/tsconfig.json"
|
"project": "./extensions/server-report/tsconfig.json"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
"ignoreVoid": true
|
"ignoreVoid": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"jsdoc/require-param": "error"
|
"jsdoc/require-param": "error",
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// Disabled until the issues can be fixed
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"rules": {
|
"rules": {
|
||||||
// Disabled until the issues can be fixed
|
// Disabled until the issues can be fixed
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/explicit-function-return-type": ["off"],
|
"@typescript-eslint/explicit-function-return-type": ["off"],
|
||||||
"@typescript-eslint/await-thenable": ["off"]
|
"@typescript-eslint/await-thenable": ["off"],
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче