Skip to content

Commit 6168249

Browse files
committed
Avoid ESLint warnings
1 parent 6f6845e commit 6168249

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/controls/src/widget_upload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class FileUploadView extends DOMWidgetView {
7272
promisesFile.push(
7373
new Promise((resolve, reject) => {
7474
const fileReader = new FileReader();
75-
fileReader.onload = () => {
75+
fileReader.onload = (): void => {
7676
// We know we can read the result as an array buffer since
7777
// we use the `.readAsArrayBuffer` method
7878
const content: ArrayBuffer = fileReader.result as ArrayBuffer;
@@ -85,7 +85,7 @@ export class FileUploadView extends DOMWidgetView {
8585
error: ''
8686
});
8787
};
88-
fileReader.onerror = () => {
88+
fileReader.onerror = (): void => {
8989
reject();
9090
};
9191
fileReader.onabort = fileReader.onerror;

packages/controls/test/src/widget_upload_test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function getProxyButton(view: widgets.FileUploadView): HTMLButtonElement {
1414
return elem as HTMLButtonElement;
1515
}
1616

17-
function fileInputForModel(model: widgets.FileUploadModel) {
17+
function fileInputForModel(model: widgets.FileUploadModel): HTMLInputElement {
1818
// For a given model, create and render a view and return the
1919
// view's input.
2020
const options = { model };
@@ -23,21 +23,23 @@ function fileInputForModel(model: widgets.FileUploadModel) {
2323
return getFileInput(view);
2424
}
2525

26-
function proxyButtonForModel(model: widgets.FileUploadModel) {
26+
function proxyButtonForModel(
27+
model: widgets.FileUploadModel
28+
): HTMLButtonElement {
2729
const options = { model };
2830
const view = new widgets.FileUploadView(options);
2931
view.render();
3032
return getProxyButton(view);
3133
}
3234

33-
function simulateUpload(fileInput: HTMLInputElement, files: Array<File>) {
35+
function simulateUpload(fileInput: HTMLInputElement, files: Array<File>): void {
3436
// The 'files' property on an input element is normally not writeable
3537
// programmatically, so we explicitly overwrite it.
3638

3739
// The type of fileInput.files is FileList, an Array with an
3840
// extra `.item` method.
3941
const fileList: any = files;
40-
fileList.item = (index: number) => files[index];
42+
fileList.item = (index: number): File => files[index];
4143
Object.defineProperty(fileInput, 'files', {
4244
value: fileList,
4345
writable: false

0 commit comments

Comments
 (0)