turn on noUnusedParameters in Schema Compare (#22452)

* turn on noUnusedParameters in Schema Compare

* use _click

* Add names to unused parameters in test files
This commit is contained in:
Kim Santiago
2023-03-28 11:17:14 -07:00
committed by GitHub
parent 929184514e
commit a7ecff77dd
5 changed files with 21 additions and 22 deletions

View File

@@ -736,7 +736,7 @@ export class SchemaCompareMainWindow {
title: loc.compare
}).component();
this.compareButton.onDidClick(async (click) => {
this.compareButton.onDidClick(async (_click) => {
await this.startCompare();
});
}
@@ -751,7 +751,7 @@ export class SchemaCompareMainWindow {
title: loc.stop
}).component();
this.cancelCompareButton.onDidClick(async (click) => {
this.cancelCompareButton.onDidClick(async (_click) => {
await this.cancelCompare();
});
}
@@ -806,7 +806,7 @@ export class SchemaCompareMainWindow {
},
}).component();
this.generateScriptButton.onDidClick(async (click) => {
this.generateScriptButton.onDidClick(async (_click) => {
await this.generateScript();
});
}
@@ -843,7 +843,7 @@ export class SchemaCompareMainWindow {
title: loc.options
}).component();
this.optionsButton.onDidClick(async (click) => {
this.optionsButton.onDidClick(async (_click) => {
TelemetryReporter.sendActionEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaCompareOptionsOpened');
// create fresh every time
this.schemaCompareOptionDialog = new SchemaCompareOptionsDialog(this.deploymentOptions, this);
@@ -861,7 +861,7 @@ export class SchemaCompareMainWindow {
},
}).component();
this.applyButton.onDidClick(async (click) => {
this.applyButton.onDidClick(async (_click) => {
await this.publishChanges();
});
}
@@ -998,7 +998,7 @@ export class SchemaCompareMainWindow {
title: loc.switchDirectionDescription
}).component();
this.switchButton.onDidClick(async (click) => {
this.switchButton.onDidClick(async (_click) => {
TelemetryReporter.sendActionEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaCompareSwitch');
// switch source and target
[this.sourceEndpointInfo, this.targetEndpointInfo] = [this.targetEndpointInfo, this.sourceEndpointInfo];
@@ -1032,7 +1032,7 @@ export class SchemaCompareMainWindow {
secondary: true
}).component();
this.selectSourceButton.onDidClick(async () => {
this.selectSourceButton.onDidClick(async (_click) => {
TelemetryReporter.sendActionEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaCompareSelectSource');
this.schemaCompareDialog = new SchemaCompareDialog(this, undefined, this.extensionContext);
this.promise = this.schemaCompareDialog.openDialog();
@@ -1046,7 +1046,7 @@ export class SchemaCompareMainWindow {
secondary: true
}).component();
this.selectTargetButton.onDidClick(async () => {
this.selectTargetButton.onDidClick(async (_click) => {
TelemetryReporter.sendActionEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaCompareSelectTarget');
this.schemaCompareDialog = new SchemaCompareDialog(this, undefined, this.extensionContext);
this.promise = await this.schemaCompareDialog.openDialog();
@@ -1064,7 +1064,7 @@ export class SchemaCompareMainWindow {
title: loc.openScmpDescription
}).component();
this.openScmpButton.onDidClick(async (click) => {
this.openScmpButton.onDidClick(async (_click) => {
await this.openScmp();
});
}
@@ -1180,7 +1180,7 @@ export class SchemaCompareMainWindow {
enabled: false
}).component();
this.saveScmpButton.onDidClick(async (click) => {
this.saveScmpButton.onDidClick(async (_click) => {
await this.saveScmp();
});
}

View File

@@ -363,7 +363,7 @@ describe('SchemaCompareMainWindow.results @DacFx@', function (): void {
function createServiceMock() {
let sc = new SchemaCompareTestService(testStateScmp.SUCCESS_NOT_EQUAL);
let service = TypeMoq.Mock.ofInstance(new SchemaCompareTestService());
service.setup(x => x.schemaCompareGetDefaultOptions()).returns(x => sc.schemaCompareGetDefaultOptions());
service.setup(x => x.schemaCompareGetDefaultOptions()).returns(() => sc.schemaCompareGetDefaultOptions());
service.setup(x => x.schemaCompare(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => sc.schemaCompare('', undefined, undefined, undefined, undefined));
return service;
}

View File

@@ -295,7 +295,7 @@ export function createViewContext(): ViewTestContext {
columns: [] as string[],
onRowSelected: onClick.event,
onCellAction: onClick.event,
appendData: (data: any[][]) => undefined
appendData: (_data: any[][]) => undefined
});
let tableBuilder: azdata.ComponentBuilder<azdata.TableComponent, azdata.TableComponentProperties> = {
component: () => table(),

View File

@@ -20,11 +20,11 @@ export class SchemaCompareTestService implements mssql.ISchemaCompareService {
}
}
schemaComparePublishDatabaseChanges(operationId: string, targetServerName: string, targetDatabaseName: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> {
schemaComparePublishDatabaseChanges(_operationId: string, _targetServerName: string, _targetDatabaseName: string, _taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> {
throw new Error('Method not implemented.');
}
schemaComparePublishProjectChanges(operationId: string, targetProjectPath: string, targetFolderStructure: mssql.ExtractTarget, taskExecutionMode: azdata.TaskExecutionMode): Thenable<mssql.SchemaComparePublishProjectResult> {
schemaComparePublishProjectChanges(_operationId: string, _targetProjectPath: string, _targetFolderStructure: mssql.ExtractTarget, _taskExecutionMode: azdata.TaskExecutionMode): Thenable<mssql.SchemaComparePublishProjectResult> {
throw new Error('Method not implemented.');
}
@@ -38,19 +38,19 @@ export class SchemaCompareTestService implements mssql.ISchemaCompareService {
return Promise.resolve(result);
}
schemaCompareIncludeExcludeNode(operationId: string, diffEntry: mssql.DiffEntry, IncludeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable<mssql.SchemaCompareIncludeExcludeResult> {
schemaCompareIncludeExcludeNode(_operationId: string, _diffEntry: mssql.DiffEntry, _IncludeRequest: boolean, _taskExecutionMode: azdata.TaskExecutionMode): Thenable<mssql.SchemaCompareIncludeExcludeResult> {
throw new Error('Method not implemented.');
}
schemaCompareOpenScmp(filePath: string): Thenable<mssql.SchemaCompareOpenScmpResult> {
schemaCompareOpenScmp(_filePath: string): Thenable<mssql.SchemaCompareOpenScmpResult> {
throw new Error('Method not implemented.');
}
schemaCompareSaveScmp(sourceEndpointInfo: mssql.SchemaCompareEndpointInfo, targetEndpointInfo: mssql.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: mssql.DeploymentOptions, scmpFilePath: string, excludedSourceObjects: mssql.SchemaCompareObjectId[], excludedTargetObjects: mssql.SchemaCompareObjectId[]): Thenable<azdata.ResultStatus> {
schemaCompareSaveScmp(_sourceEndpointInfo: mssql.SchemaCompareEndpointInfo, _targetEndpointInfo: mssql.SchemaCompareEndpointInfo, _taskExecutionMode: azdata.TaskExecutionMode, _deploymentOptions: mssql.DeploymentOptions, _scmpFilePath: string, _excludedSourceObjects: mssql.SchemaCompareObjectId[], _excludedTargetObjects: mssql.SchemaCompareObjectId[]): Thenable<azdata.ResultStatus> {
throw new Error('Method not implemented.');
}
schemaCompare(operationId: string, sourceEndpointInfo: mssql.SchemaCompareEndpointInfo, targetEndpointInfo: mssql.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: mssql.DeploymentOptions): Thenable<mssql.SchemaCompareResult> {
schemaCompare(_operationId: string, _sourceEndpointInfo: mssql.SchemaCompareEndpointInfo, _targetEndpointInfo: mssql.SchemaCompareEndpointInfo, _taskExecutionMode: azdata.TaskExecutionMode, _deploymentOptions: mssql.DeploymentOptions): Thenable<mssql.SchemaCompareResult> {
let result: mssql.SchemaCompareResult;
if (this.testState === testStateScmp.FAILURE) {
result = {
@@ -105,7 +105,7 @@ export class SchemaCompareTestService implements mssql.ISchemaCompareService {
return Promise.resolve(result);
}
schemaCompareGenerateScript(operationId: string, targetServerName: string, targetDatabaseName: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> {
schemaCompareGenerateScript(_operationId: string, _targetServerName: string, _targetDatabaseName: string, _taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> {
let result: azdata.ResultStatus;
if (this.testState === testStateScmp.FAILURE) {
result = {
@@ -123,7 +123,7 @@ export class SchemaCompareTestService implements mssql.ISchemaCompareService {
return Promise.resolve(result);
}
schemaCompareCancel(operationId: string): Thenable<azdata.ResultStatus> {
schemaCompareCancel(_operationId: string): Thenable<azdata.ResultStatus> {
let result: azdata.ResultStatus;
if (this.testState === testStateScmp.FAILURE) {
result = {
@@ -144,7 +144,7 @@ export class SchemaCompareTestService implements mssql.ISchemaCompareService {
handle?: number;
readonly providerId: string = 'MSSQL';
registerOnUpdated(handler: () => any): void {
registerOnUpdated(_handler: () => any): void {
}
}

View File

@@ -14,7 +14,6 @@
"declaration": false,
"strict": false,
"noImplicitAny": false,
"noUnusedParameters": false,
"noImplicitReturns": false,
"noUnusedLocals": false,
"strictNullChecks": false