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
@@ -66,7 +66,7 @@ export class DateCellEditing extends BaseCellRenderer<number> {
private _prevPortalAbortController: AbortController | null = null;
private openDatePicker = () => {
private readonly openDatePicker = () => {
if (
this._prevPortalAbortController &&
!this._prevPortalAbortController.signal.aborted
@@ -168,7 +168,7 @@ height: 46px;
}
};
private updateValue = () => {
private readonly updateValue = () => {
const tempValue = this.tempValue$.value;
const currentValue = this.value;
@@ -28,7 +28,7 @@ export class MultiSelectCellEditing extends BaseCellRenderer<
string[],
SelectPropertyData
> {
private popTagSelect = () => {
private readonly popTagSelect = () => {
const value = signal(this._value);
this._disposables.add({
dispose: popTagSelect(
@@ -95,7 +95,7 @@ export class NumberCellEditing extends BaseCellRenderer<
}
`;
private _getFormattedString = (value: number) => {
private readonly _getFormattedString = (value: number) => {
const enableNewFormatting =
this.view.featureFlags$.value.enable_number_formatting;
const decimals = this.property.data$.value.decimal ?? 0;
@@ -106,7 +106,7 @@ export class NumberCellEditing extends BaseCellRenderer<
: value.toString();
};
private _keydown = (e: KeyboardEvent) => {
private readonly _keydown = (e: KeyboardEvent) => {
const ctrlKey = IS_MAC ? e.metaKey : e.ctrlKey;
if (e.key.toLowerCase() === 'z' && ctrlKey) {
@@ -121,7 +121,7 @@ export class NumberCellEditing extends BaseCellRenderer<
}
};
private _setValue = (str: string = this._inputEle.value) => {
private readonly _setValue = (str: string = this._inputEle.value) => {
if (!str) {
this.onChange(undefined);
return;
@@ -28,7 +28,7 @@ export class SelectCellEditing extends BaseCellRenderer<
string,
SelectPropertyData
> {
private popTagSelect = () => {
private readonly popTagSelect = () => {
const value = signal(this._value);
this._disposables.add({
dispose: popTagSelect(
@@ -70,7 +70,7 @@ export class TextCellEditing extends BaseCellRenderer<string> {
}
`;
private _keydown = (e: KeyboardEvent) => {
private readonly _keydown = (e: KeyboardEvent) => {
if (e.key === 'Enter' && !e.isComposing) {
this._setValue();
setTimeout(() => {
@@ -79,7 +79,7 @@ export class TextCellEditing extends BaseCellRenderer<string> {
}
};
private _setValue = (str: string = this._inputEle.value) => {
private readonly _setValue = (str: string = this._inputEle.value) => {
this._inputEle.value = `${this.value ?? ''}`;
this.onChange(str);
};