Turn on editor:eslint

This commit is contained in:
Henrik Giesel 2021-05-06 23:33:28 +02:00
parent d1c99cfb7b
commit 81cf2c9bd4
8 changed files with 35 additions and 15 deletions

View file

@ -156,14 +156,14 @@ prettier_test(
]),
)
# eslint_test(
# name = "eslint",
# srcs = glob(
# [
# "*.ts",
# ],
# ),
# )
eslint_test(
name = "eslint",
srcs = glob(
[
"*.ts",
],
),
)
svelte_check(
name = "svelte_check",

View file

@ -33,7 +33,7 @@ export class Editable extends HTMLElement {
: this.innerHTML;
}
connectedCallback() {
connectedCallback(): void {
this.setAttribute("contenteditable", "");
}
}

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-non-null-assertion: "off",
*/
import type { Editable } from "./editable";
import { updateActiveButtons } from "./toolbar";

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-non-null-assertion: "off",
*/
import { filterHTML } from "html-filter";
import { updateActiveButtons, disableButtons } from "./toolbar";
import { setupI18n, ModuleName } from "lib/i18n";
@ -54,7 +58,7 @@ export function focusField(n: number): void {
export function focusIfField(x: number, y: number): boolean {
const elements = document.elementsFromPoint(x, y);
for (let i = 0; i < elements.length; i++) {
let elem = elements[i] as EditingArea;
const elem = elements[i] as EditingArea;
if (elem instanceof EditingArea) {
elem.focusEditable();
return true;
@ -158,7 +162,7 @@ export function setSticky(stickies: boolean[]): void {
});
}
export function setFormat(cmd: string, arg?: any, nosave: boolean = false): void {
export function setFormat(cmd: string, arg?: string, nosave = false): void {
document.execCommand(cmd, false, arg);
if (!nosave) {
saveField(getCurrentField() as EditingArea, "key");

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-non-null-assertion: "off",
*/
import { updateActiveButtons } from "./toolbar";
import { EditingArea } from "./editingArea";
import { caretToEnd, nodeIsElement, getBlockElement } from "./helpers";

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-non-null-assertion: "off",
*/
import { disabledKey, nightModeKey } from "components/contextKeys";
import { writable } from "svelte/store";
@ -27,7 +31,7 @@ export function initToolbar(i18n: Promise<void>): Promise<EditorToolbar> {
document.documentElement.classList.contains("night-mode")
);
toolbarResolve(new EditorToolbar({ target, anchor, context } as any));
toolbarResolve(new EditorToolbar({ target, anchor, context }));
});
});

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-non-null-assertion: "off",
*/
import { getCurrentField, setFormat } from ".";
function wrappedExceptForWhitespace(text: string, front: string, back: string): string {

View file

@ -4260,9 +4260,9 @@ svelte2tsx@^0.1.133:
pascal-case "^3.1.1"
svelte@^3.25.0:
version "3.37.0"
resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.37.0.tgz#dc7cd24bcc275cdb3f8c684ada89e50489144ccd"
integrity sha512-TRF30F4W4+d+Jr2KzUUL1j8Mrpns/WM/WacxYlo5MMb2E5Qy2Pk1Guj6GylxsW9OnKQl1tnF8q3hG/hQ3h6VUA==
version "3.38.2"
resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.38.2.tgz#55e5c681f793ae349b5cc2fe58e5782af4275ef5"
integrity sha512-q5Dq0/QHh4BLJyEVWGe7Cej5NWs040LWjMbicBGZ+3qpFWJ1YObRmUDZKbbovddLC9WW7THTj3kYbTOFmU9fbg==
symbol-tree@^3.2.4:
version "3.2.4"