build: enhance tsconfig type check (#2732)

This commit is contained in:
Himself65
2023-06-09 01:42:58 +08:00
committed by GitHub
parent fc9a9f479b
commit b383ce36cd
34 changed files with 111 additions and 68 deletions

View File

@@ -30,6 +30,7 @@ function useMouseOffset() {
el.removeEventListener('mouseleave', onMouseLeave);
};
}
return () => {};
}, []);
return [offset, outside, ref] as const;

View File

@@ -80,6 +80,7 @@ const BlockSuiteEditorImpl = (props: EditorProps): ReactElement => {
.forEach(dispose => dispose());
};
}
return () => {};
}, [editor, editor.page, page, onLoad]);
const ref = useRef<HTMLDivElement>(null);

View File

@@ -13,4 +13,5 @@ previewBlockIdAtom.onMount = set => {
window.removeEventListener('affine.embed-block-db-click', callback);
};
}
return () => {};
};

View File

@@ -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

View File

@@ -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';

View File

@@ -1,2 +1,4 @@
export * from './disable-public-link';
export * from './share-menu';
export * from './share-workspace';
export * from './styles';

View File

@@ -33,4 +33,5 @@ export function findNode<RenderProps>(
}
}
}
return undefined;
}

View File

@@ -12,6 +12,7 @@
},
"exports": {
".": "./src/index.ts",
"./api": "./src/api.ts",
"./config": "./src/config.ts",
"./constant": "./src/constant.ts",
"./workspace": "./src/workspace.ts",

View File

@@ -43,6 +43,7 @@ export function useBlockSuiteWorkspaceAvatarUrl(
dispose.dispose();
};
}
return () => {};
}, [blockSuiteWorkspace]);
return [avatar ?? null, setAvatar] as const;
}

View File

@@ -102,6 +102,7 @@ export function setUpLanguage(i: i18n) {
}
return i.changeLanguage(language);
}
return void 0;
}
// const I18nProvider = I18nextProvider;

View File

@@ -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';

View File

@@ -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;
/**

View File

@@ -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';

View File

@@ -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,

View File

@@ -4,7 +4,11 @@
"compilerOptions": {
"composite": true,
"noEmit": false,
"outDir": "lib"
"outDir": "lib",
"paths": {
"@affine/component": ["../component/src"],
"@affine/component/*": ["../component/src/components/*"]
}
},
"references": [
{

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"module": "ESNext",

View File

@@ -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 = () => {

View File

@@ -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

View File

@@ -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);
}

View File

@@ -117,6 +117,7 @@ export async function tryMigrate(
}
);
}
return void 0;
})
);
localStorage.setItem(`${dbName}-migration`, 'true');