chore: fix eslint in blocksuite (#9232)

This commit is contained in:
Saul-Mirone
2024-12-20 16:48:10 +00:00
parent bfcc53dc1f
commit 3a82da0e5b
269 changed files with 935 additions and 842 deletions

View File

@@ -45,17 +45,17 @@ export class MenuInput extends MenuFocusable {
}
`;
private onCompositionEnd = () => {
private readonly onCompositionEnd = () => {
this.data.onChange?.(this.inputRef.value);
};
private onInput = (e: InputEvent) => {
private readonly onInput = (e: InputEvent) => {
e.stopPropagation();
if (e.isComposing) return;
this.data.onChange?.(this.inputRef.value);
};
private onKeydown = (e: KeyboardEvent) => {
private readonly onKeydown = (e: KeyboardEvent) => {
e.stopPropagation();
if (e.isComposing) return;
if (e.key === 'Escape') {
@@ -71,7 +71,7 @@ export class MenuInput extends MenuFocusable {
}
};
private stopPropagation = (e: Event) => {
private readonly stopPropagation = (e: Event) => {
e.stopPropagation();
};
@@ -140,17 +140,17 @@ export class MobileMenuInput extends MenuFocusable {
}
`;
private onCompositionEnd = () => {
private readonly onCompositionEnd = () => {
this.data.onChange?.(this.inputRef.value);
};
private onInput = (e: InputEvent) => {
private readonly onInput = (e: InputEvent) => {
e.stopPropagation();
if (e.isComposing) return;
this.data.onChange?.(this.inputRef.value);
};
private stopPropagation = (e: Event) => {
private readonly stopPropagation = (e: Event) => {
e.stopPropagation();
};

View File

@@ -83,13 +83,13 @@ export class MenuComponent
}
`;
private _clickContainer = (e: MouseEvent) => {
private readonly _clickContainer = (e: MouseEvent) => {
e.stopPropagation();
this.focusInput();
this.menu.closeSubMenu();
};
private searchRef = createRef<HTMLInputElement>();
private readonly searchRef = createRef<HTMLInputElement>();
override firstUpdated() {
const input = this.searchRef.value;

View File

@@ -57,9 +57,9 @@ export function onMenuOpen(listener: MenuOpenListener) {
export class Menu {
private _cleanupFns: Array<() => void> = [];
private _currentFocused$ = signal<MenuFocusable>();
private readonly _currentFocused$ = signal<MenuFocusable>();
private _subMenu$ = signal<Menu>();
private readonly _subMenu$ = signal<Menu>();
closed = false;