mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
enable eslint on aqt/data/web/js
This commit is contained in:
parent
89279f7f5e
commit
75932db734
5 changed files with 17 additions and 9 deletions
|
@ -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",
|
||||||
|
|
|
@ -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,
|
||||||
|
|
2
qt/aqt/data/web/js/pycmd.d.ts
vendored
2
qt/aqt/data/web/js/pycmd.d.ts
vendored
|
@ -1 +1 @@
|
||||||
declare function pycmd(cmd: string, result_callback?: (arg: any) => void): any;
|
declare function pycmd(cmd: string, result_callback?: (arg: unknown) => void): unknown;
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue