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

View file

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

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

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

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

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-non-null-assertion: "off",
*/
import { disabledKey, nightModeKey } from "components/contextKeys"; import { disabledKey, nightModeKey } from "components/contextKeys";
import { writable } from "svelte/store"; import { writable } from "svelte/store";
@ -27,7 +31,7 @@ export function initToolbar(i18n: Promise<void>): Promise<EditorToolbar> {
document.documentElement.classList.contains("night-mode") 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 // 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-non-null-assertion: "off",
*/
import { getCurrentField, setFormat } from "."; import { getCurrentField, setFormat } from ".";
function wrappedExceptForWhitespace(text: string, front: string, back: string): string { function wrappedExceptForWhitespace(text: string, front: string, back: string): string {

View file

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