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
# eslint_test(
# name = "eslint",
# srcs = glob(["*.ts"]),
# )
eslint_test(
name = "eslint",
srcs = glob(["*.ts"]),
)
exports_files([
"mathjax.js",

View file

@ -8,7 +8,7 @@ function init() {
scroll: false,
// can't use "helper: 'clone'" because of a bug in jQuery 1.5
helper: function (event) {
helper: function (_event) {
return $(this).clone(false);
},
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
* 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;
document.addEventListener("DOMContentLoaded", () => {
@ -41,8 +45,8 @@ function showAnswer(txt: string): void {
document.getElementById("middle").innerHTML = txt;
}
function selectedAnswerButton() {
let node = document.activeElement as HTMLElement;
function selectedAnswerButton(): string {
const node = document.activeElement as HTMLElement;
if (!node) {
return;
}

View file

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