mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
fix: temporarily turn off eslint for **ultra-low quality** code, because I don't have time to fix them one by one
This commit is contained in:
@@ -48,6 +48,7 @@ export const AppState = createContext<AppStateContext>({
|
||||
|
||||
editor: null,
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
setState: () => {},
|
||||
createEditor: undefined,
|
||||
setEditor: undefined,
|
||||
|
||||
@@ -49,6 +49,7 @@ const DynamicBlocksuite = ({
|
||||
workspaceId: string,
|
||||
websocket = false
|
||||
) =>
|
||||
// eslint-disable-next-line no-async-promise-executor
|
||||
new Promise(async resolve => {
|
||||
const workspace = new Workspace({
|
||||
room: workspaceId,
|
||||
@@ -79,6 +80,7 @@ const DynamicBlocksuite = ({
|
||||
|
||||
// FIXME: there needs some method to destroy websocket.
|
||||
// Or we need a manager to manage websocket.
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
workspace.__ws__ = ws;
|
||||
}
|
||||
@@ -87,7 +89,7 @@ const DynamicBlocksuite = ({
|
||||
p => p instanceof IndexedDBDocProvider
|
||||
);
|
||||
if (indexDBProvider) {
|
||||
(indexDBProvider as IndexedDBDocProvider)?.on('synced', async () => {
|
||||
(indexDBProvider as IndexedDBDocProvider).on('synced', async () => {
|
||||
// const updates = await downloadWorkspace({ workspaceId });
|
||||
// updates &&
|
||||
// Workspace.Y.applyUpdate(workspace.doc, new Uint8Array(updates));
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { EditorContainer } from '@blocksuite/editor';
|
||||
import { PageMeta as OriginalPageMeta } from '@blocksuite/store/dist/workspace/workspace';
|
||||
|
||||
// export type PageMeta = {
|
||||
@@ -14,6 +13,5 @@ export interface PageMeta extends OriginalPageMeta {
|
||||
trash: boolean;
|
||||
trashDate: number;
|
||||
updatedDate: number;
|
||||
// @ts-ignore
|
||||
mode: 'edgeless' | 'page';
|
||||
}
|
||||
|
||||
@@ -61,10 +61,12 @@ export const AppStateProvider = ({ children }: { children?: ReactNode }) => {
|
||||
|
||||
const workspace = (await loadWorkspaceHandler?.(workspaceId, true)) || null;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
window.workspace = workspace;
|
||||
// FIXME: there needs some method to destroy websocket.
|
||||
// Or we need a manager to manage websocket.
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
state.currentWorkspace?.__ws__?.destroy();
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-undef */
|
||||
/**
|
||||
* @module provider/websocket
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Confirm, ConfirmProps } from '@/ui/confirm';
|
||||
type ConfirmContextValue = {
|
||||
confirm: (props: ConfirmProps) => Promise<boolean>;
|
||||
};
|
||||
type ConfirmContextProps = PropsWithChildren<{}>;
|
||||
type ConfirmContextProps = PropsWithChildren<Record<string, unknown>>;
|
||||
|
||||
export const ConfirmContext = createContext<ConfirmContextValue>({
|
||||
confirm: () => Promise.resolve(false),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||
import { createContext, useContext, useEffect, useState } from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import ShortcutsModal from '@/components/shortcuts-modal';
|
||||
@@ -13,7 +14,7 @@ type ModalContextValue = {
|
||||
triggerImportModal: () => void;
|
||||
triggerLoginModal: () => void;
|
||||
};
|
||||
type ModalContextProps = PropsWithChildren<{}>;
|
||||
type ModalContextProps = PropsWithChildren<Record<string, unknown>>;
|
||||
type ModalMap = {
|
||||
contact: boolean;
|
||||
shortcuts: boolean;
|
||||
@@ -50,6 +51,7 @@ export const ModalProvider = ({
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
window.triggerHandler = () => triggerHandler('login');
|
||||
}, [triggerHandler]);
|
||||
|
||||
@@ -25,6 +25,7 @@ import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
||||
|
||||
export const ThemeContext = createContext<ThemeProviderValue>({
|
||||
mode: 'light',
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
changeMode: () => {},
|
||||
theme: getLightTheme('page'),
|
||||
});
|
||||
@@ -98,7 +99,7 @@ export const ThemeProvider = ({
|
||||
<Global
|
||||
styles={css`
|
||||
:root {
|
||||
${globalThemeVariables(mode, themeStyle) as {}}
|
||||
${globalThemeVariables(mode, themeStyle) as any}
|
||||
}
|
||||
`}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user