Get our previously strict files a bit tighter (#604)

Now they meet noUnusedParameters
This commit is contained in:
Jordi Bunster 2021-04-27 15:27:17 -07:00 committed by GitHub
parent e8b79d6260
commit 154db1dcd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 22 additions and 29 deletions

View File

@ -22,13 +22,7 @@ export interface ReactAdapter {
export class Registerer {
public static register(): void {
ko.bindingHandlers.react = {
init: (
element: any,
wrappedValueAccessor: () => any,
allBindings?: ko.AllBindings,
viewModel?: any,
bindingContext?: ko.BindingContext
) => {
init: (element: any, wrappedValueAccessor: () => any) => {
const adapter: ReactAdapter = wrappedValueAccessor();
if (adapter.setElement) {

View File

@ -73,7 +73,7 @@ export class Splitter {
$(this.leftSide).resizable(splitterOptions);
}
private onResizeStart: JQueryUI.ResizableEvent = (e: Event, ui: JQueryUI.ResizableUIParams) => {
private onResizeStart: JQueryUI.ResizableEvent = () => {
if (this.direction === SplitterDirection.Vertical) {
$(".ui-resizable-helper").height("100%");
} else {
@ -82,9 +82,7 @@ export class Splitter {
$("iframe").css("pointer-events", "none");
};
private onResizeStop: JQueryUI.ResizableEvent = (e: Event, ui: JQueryUI.ResizableUIParams) => {
$("iframe").css("pointer-events", "auto");
};
private onResizeStop: JQueryUI.ResizableEvent = () => $("iframe").css("pointer-events", "auto");
public collapseLeft() {
this.lastX = $(this.splitter).position().left;

View File

@ -128,21 +128,21 @@ class InputTypeaheadViewModel {
},
},
callback: {
onClick: (node: any, a: any, item: OnClickItem, event: any) => {
onClick: (_node: unknown, _a: unknown, item: OnClickItem) => {
cache.selection = item;
if (params.selection) {
params.selection(item);
}
},
onResult(node: any, query: any, result: any, resultCount: any, resultCountPerGroup: any) {
onResult(_node: unknown, query: any) {
cache.inputValue = query;
if (params.inputValue) {
params.inputValue(query);
}
},
},
template: (query: string, item: any) => {
template: (_query: string, item: any) => {
// Don't display id if caption *IS* the id
return item.caption === item.value
? "<span>{{caption}}</span>"

View File

@ -11,7 +11,7 @@ let fakeAjaxResponse: AjaxResponse = {
responseType: "json",
};
export const sessions = {
create: (serverConfig: unknown, body: object): Observable<AjaxResponse> => of(fakeAjaxResponse),
create: (): Observable<AjaxResponse> => of(fakeAjaxResponse),
__setResponse: (response: AjaxResponse) => {
fakeAjaxResponse = response;
},

View File

@ -220,7 +220,7 @@ export class NotebookContentClient {
return this.contentProvider
.remove(this.getServerConfig(), path)
.toPromise()
.then((xhr: AjaxResponse) => path);
.then(() => path);
}
/**

View File

@ -23,7 +23,7 @@ export class AccessibleVerticalList {
this.onSelect = onSelect;
}
public onKeyDown = (source: any, event: KeyboardEvent): boolean => {
public onKeyDown = (_src: unknown, event: KeyboardEvent): boolean => {
const targetContainer: Element = <Element>event.target;
if (this.items == null || this.items.length === 0) {
// no items so this should be a noop

View File

@ -2,11 +2,11 @@ import { IResourceProviderClient } from "../ResourceProvider/IResourceProviderCl
import { NotebookWorkspace } from "../Contracts/DataModels";
export class NotebookWorkspaceSettingsProviderClient implements IResourceProviderClient<string> {
public async deleteAsync(url: string, apiVersion: string): Promise<void> {
public async deleteAsync(_url: string, _apiVersion: string): Promise<void> {
throw new Error("Not yet implemented");
}
public async postAsync(url: string, body: any, apiVersion: string): Promise<any> {
public async postAsync(_url: string, _body: any, _apiVersion: string): Promise<any> {
return Promise.resolve({
notebookServerEndpoint: "http://localhost:8888",
username: "",
@ -14,37 +14,37 @@ export class NotebookWorkspaceSettingsProviderClient implements IResourceProvide
});
}
public async getAsync(url: string, apiVersion: string): Promise<string> {
public async getAsync(): Promise<string> {
throw new Error("Not yet implemented");
}
public async putAsync(url: string, body: any, apiVersion: string): Promise<string> {
public async putAsync(): Promise<string> {
throw new Error("Not yet implemented");
}
public async patchAsync(url: string, apiVersion: string): Promise<string> {
public async patchAsync(): Promise<string> {
throw new Error("Not yet implemented");
}
}
export class NotebookWorkspaceResourceProviderClient implements IResourceProviderClient<NotebookWorkspace> {
public async deleteAsync(url: string, apiVersion: string): Promise<void> {
public async deleteAsync(): Promise<void> {
throw new Error("Not yet implemented");
}
public async postAsync(url: string, body: any, apiVersion: string): Promise<NotebookWorkspace> {
public async postAsync(): Promise<NotebookWorkspace> {
throw new Error("Not yet implemented");
}
public async getAsync(url: string, apiVersion: string): Promise<NotebookWorkspace | NotebookWorkspace[]> {
public async getAsync(): Promise<NotebookWorkspace | NotebookWorkspace[]> {
throw new Error("Not yet implemented");
}
public async putAsync(url: string, body: any, apiVersion: string): Promise<NotebookWorkspace> {
public async putAsync(): Promise<NotebookWorkspace> {
throw new Error("Not yet implemented");
}
public async patchAsync(url: string, body: any, apiVersion: string): Promise<NotebookWorkspace> {
public async patchAsync(): Promise<NotebookWorkspace> {
throw new Error("Not yet implemented");
}
}

View File

@ -9,7 +9,7 @@ import { HttpHeaders, TerminalQueryParams } from "../Common/Constants";
const getUrlVars = (): { [key: string]: string } => {
const vars: { [key: string]: string } = {};
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, (m, key, value): string => {
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, (_m, key, value): string => {
vars[key] = decodeURIComponent(value);
return value;
});

View File

@ -4,7 +4,8 @@
"noEmit": true,
"strictNullChecks": true,
"strict": true,
"noUnusedLocals": true
"noUnusedLocals": true,
"noUnusedParameters": true
},
"files": [
"./src/AuthType.ts",