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
@@ -8,7 +8,7 @@ import type {
import { EventScopeSourceType, EventSourceState } from '../state/source.js';
export class RangeControl {
private _buildScope = (eventName: EventName) => {
private readonly _buildScope = (eventName: EventName) => {
let scope: EventHandlerRunner[] | undefined;
const selection = document.getSelection();
if (selection && selection.rangeCount > 0) {
@@ -23,19 +23,19 @@ export class RangeControl {
return scope;
};
private _compositionEnd = (event: Event) => {
private readonly _compositionEnd = (event: Event) => {
const scope = this._buildScope('compositionEnd');
this._dispatcher.run('compositionEnd', this._createContext(event), scope);
};
private _compositionStart = (event: Event) => {
private readonly _compositionStart = (event: Event) => {
const scope = this._buildScope('compositionStart');
this._dispatcher.run('compositionStart', this._createContext(event), scope);
};
private _compositionUpdate = (event: Event) => {
private readonly _compositionUpdate = (event: Event) => {
const scope = this._buildScope('compositionUpdate');
this._dispatcher.run(
@@ -47,7 +47,7 @@ export class RangeControl {
private _prev: Range | null = null;
private _selectionChange = (event: Event) => {
private readonly _selectionChange = (event: Event) => {
const selection = document.getSelection();
if (!selection) return;
@@ -59,7 +59,7 @@ export class RangeControl {
this._dispatcher.run('selectionChange', this._createContext(event), scope);
};
constructor(private _dispatcher: UIEventDispatcher) {}
constructor(private readonly _dispatcher: UIEventDispatcher) {}
private _buildEventScopeByNativeRange(name: EventName, range: Range) {
const blockIds = this._findBlockComponentPath(range);