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
@@ -82,13 +82,13 @@ export class FilterConditionView extends SignalWatcher(ShadowlessElement) {
}
`;
private onClickButton = (evt: Event) => {
private readonly onClickButton = (evt: Event) => {
this.popConditionEdit(
popupTargetFromElement(evt.currentTarget as HTMLElement)
);
};
private popConditionEdit = (target: PopupTarget) => {
private readonly popConditionEdit = (target: PopupTarget) => {
const type = this.leftVar$.value?.type;
if (!type) {
return;
@@ -184,7 +184,7 @@ export class FilterGroupView extends SignalWatcher(ShadowlessElement) {
}
`;
private _addNew = (e: MouseEvent) => {
private readonly _addNew = (e: MouseEvent) => {
if (this.isMaxDepth) {
this.onChange({
...this.filterGroup.value,
@@ -202,7 +202,7 @@ export class FilterGroupView extends SignalWatcher(ShadowlessElement) {
});
};
private _selectOp = (event: MouseEvent) => {
private readonly _selectOp = (event: MouseEvent) => {
popFilterableSimpleMenu(
popupTargetFromElement(event.currentTarget as HTMLElement),
[
@@ -228,7 +228,7 @@ export class FilterGroupView extends SignalWatcher(ShadowlessElement) {
);
};
private _setFilter = (index: number, filter: Filter) => {
private readonly _setFilter = (index: number, filter: Filter) => {
this.onChange({
...this.filterGroup.value,
conditions: this.filterGroup.value.conditions.map((v, i) =>
@@ -237,7 +237,7 @@ export class FilterGroupView extends SignalWatcher(ShadowlessElement) {
});
};
private opMap = {
private readonly opMap = {
and: 'And',
or: 'Or',
};
@@ -77,7 +77,7 @@ export class FilterBar extends SignalWatcher(ShadowlessElement) {
}
`;
private _setFilter = (index: number, filter: Filter) => {
private readonly _setFilter = (index: number, filter: Filter) => {
this.onChange({
...this.filterGroup.value,
conditions: this.filterGroup.value.conditions.map((v, i) =>
@@ -86,7 +86,7 @@ export class FilterBar extends SignalWatcher(ShadowlessElement) {
});
};
private addFilter = (e: MouseEvent) => {
private readonly addFilter = (e: MouseEvent) => {
const element = popupTargetFromElement(e.target as HTMLElement);
popCreateFilter(element, {
vars: this.vars,
@@ -103,7 +103,7 @@ export class FilterBar extends SignalWatcher(ShadowlessElement) {
});
};
private expandGroup = (position: PopupTarget, i: number) => {
private readonly expandGroup = (position: PopupTarget, i: number) => {
if (this.filterGroup.value.conditions[i]?.type !== 'group') {
return;
}
@@ -158,7 +158,7 @@ export class FilterRootView extends SignalWatcher(ShadowlessElement) {
}
`;
private _setFilter = (index: number, filter: Filter) => {
private readonly _setFilter = (index: number, filter: Filter) => {
this.onChange({
...this.filterGroup.value,
conditions: this.filterGroup.value.conditions.map((v, i) =>
@@ -167,7 +167,7 @@ export class FilterRootView extends SignalWatcher(ShadowlessElement) {
});
};
private expandGroup = (position: PopupTarget, i: number) => {
private readonly expandGroup = (position: PopupTarget, i: number) => {
if (this.filterGroup.value.conditions[i]?.type !== 'group') {
return;
}