chore: upgrade to eslint9 (#9163)

This commit is contained in:
Brooooooklyn
2024-12-14 10:29:04 +00:00
parent f49bef4915
commit aaaea8918f
37 changed files with 681 additions and 736 deletions

View File

@@ -1,7 +1,6 @@
import { CONSTRUCTOR_CONTEXT } from '../constructor-context';
import type { FrameworkProvider } from '../provider';
// eslint-disable-next-line @typescript-eslint/ban-types
export class Component<Props = {}> {
readonly framework: FrameworkProvider;

View File

@@ -1,6 +1,5 @@
import { Component } from './component';
// eslint-disable-next-line @typescript-eslint/ban-types
export class Entity<Props = {}> extends Component<Props> {
readonly __isEntity = true;
}

View File

@@ -1,6 +1,5 @@
import { Component } from './component';
// eslint-disable-next-line @typescript-eslint/ban-types
export class Scope<Props = {}> extends Component<Props> {
readonly __injectable = true;

View File

@@ -1,6 +1,5 @@
import type { FrameworkProvider } from './provider';
// eslint-disable-next-line @typescript-eslint/ban-types
export type Type<T = any> = abstract new (...args: any) => T;
export type ComponentFactory<T = any> = (provider: FrameworkProvider) => T;

View File

@@ -18,6 +18,7 @@ export function useFramework(): FrameworkProvider {
export function useService<T extends Service>(
identifier: GeneralIdentifier<T>
): T {
// eslint-disable-next-line react-hooks/rules-of-hooks
const stack = useContext(FrameworkStackContext);
let service: T | undefined = undefined;
@@ -85,6 +86,7 @@ export function useServices<
export function useServiceOptional<T extends Service>(
identifier: Type<T>
): T | undefined {
// eslint-disable-next-line react-hooks/rules-of-hooks
const stack = useContext(FrameworkStackContext);
let service: T | undefined = undefined;

View File

@@ -57,7 +57,6 @@ export class WorkspaceDBService extends Service {
) as WorkspaceDBWithTables<AFFiNEWorkspaceDbSchema>;
}
// eslint-disable-next-line @typescript-eslint/ban-types
userdataDB(userId: (string & {}) | '__local__') {
// __local__ for local workspace
const userdataDb = this.userdataDBPool.get(userId);

View File

@@ -28,8 +28,8 @@ export class SpaceStorageClient extends OpClient<SpaceStorageOps> {
await this.call('disconnect');
}
override async destroy() {
await this.call('destroy');
override destroy() {
this.call('destroy').catch(console.error);
super.destroy();
}
@@ -46,8 +46,8 @@ export class SpaceStorageWorkerClient extends SpaceStorageClient {
this.worker = worker;
}
override async destroy() {
await super.destroy();
override destroy() {
super.destroy();
this.worker.terminate();
}
}

View File

@@ -1,9 +1,9 @@
import EventEmitter2 from 'eventemitter2';
import type { ConnectionStatus } from '../connection';
import { type Storage, type StorageType } from './storage';
import type { BlobStorage } from './blob';
import type { DocStorage } from './doc';
import { type Storage, type StorageType } from './storage';
import type { SyncStorage } from './sync';
type Storages = DocStorage | BlobStorage | SyncStorage;