Fix many ESlint errors (#1265)

* Unvendor toml package

* Fix many ESlint errors

For mysterious reasons, these errors appear on my branch #1262 even
though they are not related to changes there. The eslint config seems
a bit unstable.

Anyways this fixes them.

* Put back Record

* Fix typescript compilation

* Fix lints

* Try @iarna/toml instead

* Fix import

* Use @ltd/j-toml

* Update test

* Use toml-j0.4

* Some changes

* Fix toml import

* Try adding eslint gha job

* Add forgotten checkout action

* Force CI to run

* Blah

* Fix

* Revert changes to github workflow

* Fix lints

* wget toml-j0.4 type definitions

* Add toml-j types workaround to eslint workflow

* Apply formatter

* Use @hoodmane/toml-j0.4

* Import from @hoodmane/toml-j0.4
This commit is contained in:
Hood Chatham
2023-03-13 15:51:28 +01:00
committed by GitHub
parent 653e2c9be4
commit 37c9db09c6
18 changed files with 196 additions and 122 deletions

View File

@@ -1,4 +1,4 @@
import type { PyProxy } from 'pyodide';
import type { PyProxy, PyProxyCallable } from 'pyodide';
import { getLogger } from '../logger';
import { robustFetch } from '../fetch';
import { InterpreterClient } from '../interpreter_client';
@@ -13,8 +13,8 @@ function createWidget(interpreter: InterpreterClient, name: string, code: string
name: string = name;
klass: string = klass;
code: string = code;
proxy: PyProxy;
proxyClass: any;
proxy: PyProxy & { connect(): void };
proxyClass: PyProxyCallable;
constructor() {
super();
@@ -28,8 +28,8 @@ function createWidget(interpreter: InterpreterClient, name: string, code: string
async connectedCallback() {
await interpreter.runButDontRaise(this.code);
this.proxyClass = interpreter.globals.get(this.klass);
this.proxy = this.proxyClass(this);
this.proxyClass = interpreter.globals.get(this.klass) as PyProxyCallable;
this.proxy = this.proxyClass(this) as PyProxy & { connect(): void };
this.proxy.connect();
this.registerWidget();
}
@@ -39,9 +39,8 @@ function createWidget(interpreter: InterpreterClient, name: string, code: string
interpreter.globals.set(this.id, this.proxy);
}
}
/* eslint-disable @typescript-eslint/no-unused-vars */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const xPyWidget = customElements.define(name, CustomWidget);
/* eslint-enable @typescript-eslint/no-unused-vars */
}
export function make_PyWidget(interpreter: InterpreterClient) {