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

@@ -2,7 +2,7 @@ import { basicSetup, EditorView } from 'codemirror';
import { python } from '@codemirror/lang-python';
import { indentUnit } from '@codemirror/language';
import { Compartment } from '@codemirror/state';
import { keymap } from '@codemirror/view';
import { keymap, Command } from '@codemirror/view';
import { defaultKeymap } from '@codemirror/commands';
import { oneDarkTheme } from '@codemirror/theme-one-dark';
@@ -68,8 +68,8 @@ export function make_PyRepl(interpreter: InterpreterClient) {
languageConf.of(python()),
keymap.of([
...defaultKeymap,
{ key: 'Ctrl-Enter', run: this.execute.bind(this), preventDefault: true },
{ key: 'Shift-Enter', run: this.execute.bind(this), preventDefault: true },
{ key: 'Ctrl-Enter', run: this.execute.bind(this) as Command, preventDefault: true },
{ key: 'Shift-Enter', run: this.execute.bind(this) as Command, preventDefault: true },
]),
];
@@ -134,7 +134,7 @@ export function make_PyRepl(interpreter: InterpreterClient) {
runButton.id = 'runButton';
runButton.className = 'absolute py-repl-run-button';
runButton.innerHTML = RUNBUTTON;
runButton.addEventListener('click', this.execute.bind(this));
runButton.addEventListener('click', this.execute.bind(this) as (e: MouseEvent) => void);
return runButton;
}
@@ -166,6 +166,7 @@ export function make_PyRepl(interpreter: InterpreterClient) {
outEl.innerHTML = '';
// execute the python code
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const pyResult = (await pyExec(interpreter, pySrc, outEl)).result;
// display the value of the last evaluated expression (REPL-style)