enable eslint on aqt/data/web/js

This commit is contained in:
Damien Elmes 2021-10-18 15:20:00 +10:00
parent 89279f7f5e
commit 75932db734
5 changed files with 17 additions and 9 deletions

View file

@ -60,10 +60,10 @@ prettier_test(
) )
# source files need fixing first # source files need fixing first
# eslint_test( eslint_test(
# name = "eslint", name = "eslint",
# srcs = glob(["*.ts"]), srcs = glob(["*.ts"]),
# ) )
exports_files([ exports_files([
"mathjax.js", "mathjax.js",

View file

@ -8,7 +8,7 @@ function init() {
scroll: false, scroll: false,
// can't use "helper: 'clone'" because of a bug in jQuery 1.5 // can't use "helper: 'clone'" because of a bug in jQuery 1.5
helper: function (event) { helper: function (_event) {
return $(this).clone(false); return $(this).clone(false);
}, },
delay: 200, delay: 200,

View file

@ -1 +1 @@
declare function pycmd(cmd: string, result_callback?: (arg: any) => void): any; declare function pycmd(cmd: string, result_callback?: (arg: unknown) => void): unknown;

View file

@ -1,7 +1,11 @@
/* Copyright: Ankitects Pty Ltd and contributors /* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */ * License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
var time: number; // set in python code /* eslint
@typescript-eslint/no-unused-vars: "off",
*/
let time: number; // set in python code
let maxTime = 0; let maxTime = 0;
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
@ -41,8 +45,8 @@ function showAnswer(txt: string): void {
document.getElementById("middle").innerHTML = txt; document.getElementById("middle").innerHTML = txt;
} }
function selectedAnswerButton() { function selectedAnswerButton(): string {
let node = document.activeElement as HTMLElement; const node = document.activeElement as HTMLElement;
if (!node) { if (!node) {
return; return;
} }

View file

@ -1,6 +1,10 @@
// Copyright: Ankitects Pty Ltd and contributors // Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
/* eslint
@typescript-eslint/no-unused-vars: "off",
*/
enum SyncState { enum SyncState {
NoChanges = 0, NoChanges = 0,
Normal, Normal,