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

@@ -35,7 +35,7 @@ export class BlockComponent<
@consume({ context: stdContext })
accessor std!: BlockStdScope;
private _selected = computed(() => {
private readonly _selected = computed(() => {
const selection = this.std.selection.value.find(selection => {
return selection.blockId === this.model?.id;
});

View File

@@ -108,13 +108,13 @@ export abstract class GfxBlockComponent<
const parent = this.parentElement;
if (this.hasUpdated || !parent || !('scheduleUpdateChildren' in parent)) {
super.scheduleUpdate();
return super.scheduleUpdate();
} else {
await (parent.scheduleUpdateChildren as (id: string) => Promise<void>)(
this.model.id
);
super.scheduleUpdate();
return super.scheduleUpdate();
}
}
@@ -207,13 +207,13 @@ export function toGfxBlockComponent<
const parent = this.parentElement;
if (this.hasUpdated || !parent || !('scheduleUpdateChildren' in parent)) {
super.scheduleUpdate();
return super.scheduleUpdate();
} else {
await (parent.scheduleUpdateChildren as (id: string) => Promise<void>)(
this.model.id
);
super.scheduleUpdate();
return super.scheduleUpdate();
}
}

View File

@@ -41,7 +41,7 @@ export class EditorHost extends SignalWatcher(
}
`;
private _renderModel = (model: BlockModel): TemplateResult => {
private readonly _renderModel = (model: BlockModel): TemplateResult => {
const { flavour } = model;
const block = this.doc.getBlock(model.id);
if (!block || block.blockViewType === BlockViewType.Hidden) {

View File

@@ -6,7 +6,7 @@ export class ViewStore extends LifeCycleWatcher {
private readonly _blockMap = new Map<string, BlockComponent>();
private _fromId = (
private readonly _fromId = (
blockId: string | undefined | null
): BlockComponent | null => {
const id = blockId ?? this.std.doc.root?.id;