mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
build: enhance tsconfig type check (#2732)
This commit is contained in:
@@ -30,6 +30,7 @@ function useMouseOffset() {
|
||||
el.removeEventListener('mouseleave', onMouseLeave);
|
||||
};
|
||||
}
|
||||
return () => {};
|
||||
}, []);
|
||||
|
||||
return [offset, outside, ref] as const;
|
||||
|
||||
@@ -80,6 +80,7 @@ const BlockSuiteEditorImpl = (props: EditorProps): ReactElement => {
|
||||
.forEach(dispose => dispose());
|
||||
};
|
||||
}
|
||||
return () => {};
|
||||
}, [editor, editor.page, page, onLoad]);
|
||||
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -13,4 +13,5 @@ previewBlockIdAtom.onMount = set => {
|
||||
window.removeEventListener('affine.embed-block-db-click', callback);
|
||||
};
|
||||
}
|
||||
return () => {};
|
||||
};
|
||||
|
||||
@@ -183,6 +183,7 @@ function NotificationCard(props: NotificationCardProps): ReactElement {
|
||||
if (notification.undo) {
|
||||
return notification.undo();
|
||||
}
|
||||
return void 0;
|
||||
}, [notification]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -200,6 +201,7 @@ function NotificationCard(props: NotificationCardProps): ReactElement {
|
||||
h.filter(height => height.notificationKey !== notification.key)
|
||||
);
|
||||
}
|
||||
return () => {};
|
||||
}, [notification.key, setHeights]);
|
||||
return (
|
||||
<Toast.Root
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export * from './all-page';
|
||||
export * from './components/favorite-tag';
|
||||
export * from './components/new-page-buttton';
|
||||
export * from './components/title-cell';
|
||||
export * from './filter';
|
||||
export * from './operation-cell';
|
||||
export * from './operation-menu-items';
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
export * from './disable-public-link';
|
||||
export * from './share-menu';
|
||||
export * from './share-workspace';
|
||||
export * from './styles';
|
||||
|
||||
@@ -33,4 +33,5 @@ export function findNode<RenderProps>(
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
1
packages/env/package.json
vendored
1
packages/env/package.json
vendored
@@ -12,6 +12,7 @@
|
||||
},
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./api": "./src/api.ts",
|
||||
"./config": "./src/config.ts",
|
||||
"./constant": "./src/constant.ts",
|
||||
"./workspace": "./src/workspace.ts",
|
||||
|
||||
@@ -43,6 +43,7 @@ export function useBlockSuiteWorkspaceAvatarUrl(
|
||||
dispose.dispose();
|
||||
};
|
||||
}
|
||||
return () => {};
|
||||
}, [blockSuiteWorkspace]);
|
||||
return [avatar ?? null, setAvatar] as const;
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@ export function setUpLanguage(i: i18n) {
|
||||
}
|
||||
return i.changeLanguage(language);
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
|
||||
// const I18nProvider = I18nextProvider;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// cSpell:ignore Tolgee
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import * as fs from 'node:fs/promises';
|
||||
import * as path from 'node:path';
|
||||
|
||||
import { format } from 'prettier';
|
||||
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
// cSpell:ignore Tolgee
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import { readFile } from 'fs/promises';
|
||||
import path from 'path';
|
||||
|
||||
import { createsNewKey, getRemoteTranslations } from './api.js';
|
||||
import type { TranslationRes } from './utils.js';
|
||||
|
||||
const BASE_JSON_PATH = path.resolve(
|
||||
process.cwd(),
|
||||
'src',
|
||||
'resources',
|
||||
'en.json'
|
||||
);
|
||||
const BASE_JSON_PATH = resolve(process.cwd(), 'src', 'resources', 'en.json');
|
||||
const BASE_LANGUAGES = 'en' as const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Empty } from '@affine/component';
|
||||
import { toast } from '@affine/component';
|
||||
import { AffineLoading } from '@affine/component/affine-loading';
|
||||
import { PageListTrashView } from '@affine/component/page-list/all-page';
|
||||
import { PageList } from '@affine/component/page-list/all-page';
|
||||
import { NewPageButton } from '@affine/component/page-list/components/new-page-buttton';
|
||||
import type { OperationCellProps } from '@affine/component/page-list/operation-cell';
|
||||
import { OperationCell } from '@affine/component/page-list/operation-cell';
|
||||
import type { OperationCellProps } from '@affine/component/page-list';
|
||||
import { PageListTrashView } from '@affine/component/page-list';
|
||||
import { PageList } from '@affine/component/page-list';
|
||||
import { NewPageButton } from '@affine/component/page-list';
|
||||
import { OperationCell } from '@affine/component/page-list';
|
||||
import { PageIcon } from '@blocksuite/icons';
|
||||
import { expect } from '@storybook/jest';
|
||||
import type { StoryFn } from '@storybook/react';
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { toast } from '@affine/component';
|
||||
import { PublicLinkDisableModal } from '@affine/component/share-menu/disable-public-link';
|
||||
import {
|
||||
PublicLinkDisableModal,
|
||||
StyledDisableButton,
|
||||
} from '@affine/component/share-menu';
|
||||
import { ShareMenu } from '@affine/component/share-menu/share-menu';
|
||||
import { StyledDisableButton } from '@affine/component/share-menu/styles';
|
||||
import type {
|
||||
AffineLegacyCloudWorkspace,
|
||||
LocalWorkspace,
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"noEmit": false,
|
||||
"outDir": "lib"
|
||||
"outDir": "lib",
|
||||
"paths": {
|
||||
"@affine/component": ["../component/src"],
|
||||
"@affine/component/*": ["../component/src/components/*"]
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "ESNext",
|
||||
|
||||
@@ -75,6 +75,7 @@ const signInWithElectron = async (firebaseAuth: FirebaseAuth) => {
|
||||
const user = await signInWithCredential(firebaseAuth, credential);
|
||||
return await user.user.getIdToken();
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
export const clearLoginStorage = () => {
|
||||
|
||||
@@ -48,6 +48,7 @@ rootCurrentWorkspaceIdAtom.onMount = set => {
|
||||
Router.events.off('routeChangeStart', callback);
|
||||
};
|
||||
}
|
||||
return () => {};
|
||||
};
|
||||
|
||||
export const rootCurrentPageIdAtom = atom<string | null>(null);
|
||||
@@ -68,6 +69,7 @@ rootCurrentPageIdAtom.onMount = set => {
|
||||
Router.events.off('routeChangeStart', callback);
|
||||
};
|
||||
}
|
||||
return () => {};
|
||||
};
|
||||
|
||||
// current editor atom, each app should have only one editor in the same time
|
||||
|
||||
@@ -101,7 +101,7 @@ export class CallbackSet extends Set<() => void> {
|
||||
this.#ready = v;
|
||||
}
|
||||
|
||||
add(cb: () => void) {
|
||||
override add(cb: () => void) {
|
||||
if (this.ready) {
|
||||
cb();
|
||||
return this;
|
||||
@@ -112,7 +112,7 @@ export class CallbackSet extends Set<() => void> {
|
||||
return super.add(cb);
|
||||
}
|
||||
|
||||
delete(cb: () => void) {
|
||||
override delete(cb: () => void) {
|
||||
if (this.has(cb)) {
|
||||
return super.delete(cb);
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ export async function tryMigrate(
|
||||
}
|
||||
);
|
||||
}
|
||||
return void 0;
|
||||
})
|
||||
);
|
||||
localStorage.setItem(`${dbName}-migration`, 'true');
|
||||
|
||||
Reference in New Issue
Block a user