mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-20 01:01:20 -05:00
Remove all but 2 eslint-disable pragmas (#1335)
Turns off: - no-explicit-any (we need to handle any return values from runPython) - no-unsafe-assignment (noisy and pointless) And resolves all but two remaining ones. The last two lints regard access to private Pyodide variables and so: - they are not easy to work around without an upstream Pyodide patch - they should trigger linter and require explicit override
This commit is contained in:
@@ -7,10 +7,8 @@ function createCustomElements(interpreter: InterpreterClient, app: PyScriptApp)
|
||||
const PyWidget = make_PyWidget(interpreter);
|
||||
const PyRepl = make_PyRepl(interpreter, app);
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
const xPyRepl = customElements.define('py-repl', PyRepl);
|
||||
const xPyWidget = customElements.define('py-register-widget', PyWidget);
|
||||
/* eslint-enable @typescript-eslint/no-unused-vars */
|
||||
customElements.define('py-repl', PyRepl);
|
||||
customElements.define('py-register-widget', PyWidget);
|
||||
}
|
||||
|
||||
export { createCustomElements };
|
||||
|
||||
@@ -133,14 +133,13 @@ export function make_PyRepl(interpreter: InterpreterClient, app: PyScriptApp) {
|
||||
|
||||
// execute the python code
|
||||
await app.plugins.beforePyReplExec({ interpreter: interpreter, src: pySrc, outEl: outEl, pyReplTag: this });
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const { result } = await pyExec(interpreter, pySrc, outEl);
|
||||
await app.plugins.afterPyReplExec({
|
||||
interpreter: interpreter,
|
||||
src: pySrc,
|
||||
outEl: outEl,
|
||||
pyReplTag: this,
|
||||
result, // eslint-disable-line @typescript-eslint/no-unsafe-assignment
|
||||
result,
|
||||
});
|
||||
|
||||
this.autogenerateMaybe();
|
||||
|
||||
@@ -36,7 +36,6 @@ export function make_PyScript(interpreter: InterpreterClient, app: PyScriptApp)
|
||||
this.innerHTML = '';
|
||||
|
||||
await app.plugins.beforePyScriptExec({ interpreter: interpreter, src: pySrc, pyScriptTag: this });
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
const result = (await pyExec(interpreter, pySrc, this)).result;
|
||||
await app.plugins.afterPyScriptExec({
|
||||
interpreter: interpreter,
|
||||
@@ -44,7 +43,6 @@ export function make_PyScript(interpreter: InterpreterClient, app: PyScriptApp)
|
||||
pyScriptTag: this,
|
||||
result: result,
|
||||
});
|
||||
/* eslint-enable @typescript-eslint/no-unsafe-assignment */
|
||||
} finally {
|
||||
releaseLock();
|
||||
app.decrementPendingTags();
|
||||
|
||||
@@ -40,8 +40,7 @@ function createWidget(interpreter: InterpreterClient, name: string, code: string
|
||||
await interpreter.globals.set(this.id, this.proxy);
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const xPyWidget = customElements.define(name, CustomWidget);
|
||||
customElements.define(name, CustomWidget);
|
||||
}
|
||||
|
||||
export function make_PyWidget(interpreter: InterpreterClient) {
|
||||
|
||||
Reference in New Issue
Block a user