mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
chore: upgrade to eslint9 (#9163)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user