No console linting (#9156)

* add no-console linting and change to just using overrides for sql files

* whitespace

* fix tests
This commit is contained in:
Anthony Dresser
2020-02-14 21:13:16 -06:00
committed by GitHub
parent 6b0332b2d1
commit 74b89a0a85
31 changed files with 107 additions and 105 deletions

View File

@@ -42,6 +42,7 @@ import { TreeViewItemHandleArg } from 'sql/workbench/common/views';
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { IQueryManagementService } from 'sql/workbench/services/query/common/queryManagement';
import { ILogService } from 'vs/platform/log/common/log';
/**
* Action class that query-based Actions will extend. This base class automatically handles activating and
@@ -268,7 +269,8 @@ export class CancelQueryAction extends QueryTaskbarAction {
constructor(
editor: QueryEditor,
@IQueryModelService private readonly queryModelService: IQueryModelService,
@IConnectionManagementService connectionManagementService: IConnectionManagementService
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
@ILogService private readonly logService: ILogService
) {
super(connectionManagementService, editor, CancelQueryAction.ID, CancelQueryAction.EnabledClass);
this.enabled = false;
@@ -278,7 +280,7 @@ export class CancelQueryAction extends QueryTaskbarAction {
public async run(): Promise<void> {
if (this.isConnected(this.editor)) {
if (!this.editor.input) {
console.error('editor input was null');
this.logService.error('editor input was null');
return;
}
this.queryModelService.cancelQuery(this.editor.input.uri);
@@ -526,7 +528,8 @@ export class ToggleSqlCmdModeAction extends QueryTaskbarAction {
private _isSqlCmdMode: boolean,
@IQueryManagementService protected readonly queryManagementService: IQueryManagementService,
@IConfigurationService protected readonly configurationService: IConfigurationService,
@IConnectionManagementService connectionManagementService: IConnectionManagementService
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
@ILogService private readonly logService: ILogService
) {
super(connectionManagementService, editor, ToggleSqlCmdModeAction.ID, undefined);
}
@@ -554,7 +557,7 @@ export class ToggleSqlCmdModeAction extends QueryTaskbarAction {
let queryoptions: QueryExecutionOptions = { options: {} };
queryoptions.options['isSqlCmdMode'] = toSqlCmdState;
if (!this.editor.input) {
console.error('editor input was null');
this.logService.error('editor input was null');
return;
}
this.queryManagementService.setQueryExecutionOptions(this.editor.input.uri, queryoptions);
@@ -586,7 +589,8 @@ export class ListDatabasesActionItem extends Disposable implements IActionViewIt
@IContextViewService contextViewProvider: IContextViewService,
@IConnectionManagementService private readonly connectionManagementService: IConnectionManagementService,
@INotificationService private readonly notificationService: INotificationService,
@IConfigurationService private readonly configurationService: IConfigurationService
@IConfigurationService private readonly configurationService: IConfigurationService,
@ILogService private readonly logService: ILogService
) {
super();
this._databaseListDropdown = $('.databaseListDropdown');
@@ -680,7 +684,7 @@ export class ListDatabasesActionItem extends Disposable implements IActionViewIt
// PRIVATE HELPERS /////////////////////////////////////////////////////
private databaseSelected(dbName: string): void {
if (!this._editor.input) {
console.error('editor input was null');
this.logService.error('editor input was null');
return;
}
@@ -716,7 +720,7 @@ export class ListDatabasesActionItem extends Disposable implements IActionViewIt
private getCurrentDatabaseName(): string | undefined {
if (!this._editor.input) {
console.error('editor input was null');
this.logService.error('editor input was null');
return undefined;
}
@@ -744,7 +748,7 @@ export class ListDatabasesActionItem extends Disposable implements IActionViewIt
}
if (!this._editor.input) {
console.error('editor input was null');
this.logService.error('editor input was null');
return;
}
@@ -758,7 +762,7 @@ export class ListDatabasesActionItem extends Disposable implements IActionViewIt
private onDropdownFocus(): void {
if (!this._editor.input) {
console.error('editor input was null');
this.logService.error('editor input was null');
return;
}
@@ -782,7 +786,7 @@ export class ListDatabasesActionItem extends Disposable implements IActionViewIt
if (this._isInAccessibilityMode) {
this._databaseSelectBox.enable();
if (!this._editor.input) {
console.error('editor input was null');
this.logService.error('editor input was null');
return;
}
let uri = this._editor.input.uri;