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
|
||||
# eslint_test(
|
||||
# name = "eslint",
|
||||
# srcs = glob(["*.ts"]),
|
||||
# )
|
||||
eslint_test(
|
||||
name = "eslint",
|
||||
srcs = glob(["*.ts"]),
|
||||
)
|
||||
|
||||
exports_files([
|
||||
"mathjax.js",
|
||||
|
|
|
@ -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,
|
||||
|
|
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
|
||||
* 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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue