chore: turn on ts/method-signature-style (#55167)

This commit is contained in:
thinkasany
2025-09-28 10:15:00 +08:00
committed by GitHub
parent 2589e693cf
commit 8a7e15460c
5 changed files with 5 additions and 6 deletions

View File

@@ -70,6 +70,6 @@ export interface MessageInstance {
error: TypeOpen;
warning: TypeOpen;
loading: TypeOpen;
open(args: ArgsProps): MessageType;
destroy(key?: React.Key): void;
open: (args: ArgsProps) => MessageType;
destroy: (key?: React.Key) => void;
}

View File

@@ -16,7 +16,7 @@ interface ElementsHolderRef {
// Add `then` field for `ModalFunc` return instance.
export type ModalFuncWithPromise = (...args: Parameters<ModalFunc>) => ReturnType<ModalFunc> & {
then<T>(resolve: (confirmed: boolean) => T, reject: VoidFunction): Promise<T>;
then: <T>(resolve: (confirmed: boolean) => T, reject: VoidFunction) => Promise<T>;
};
export type HookAPI = Omit<Record<keyof ModalStaticFunctions, ModalFuncWithPromise>, 'warn'>;

View File

@@ -49,7 +49,7 @@ export interface NotificationInstance {
info: StaticFn;
warning: StaticFn;
open: StaticFn;
destroy(key?: React.Key): void;
destroy: (key?: React.Key) => void;
}
export interface GlobalConfigProps {

View File

@@ -33,7 +33,6 @@ export default antfu(
'ts/explicit-function-return-type': 'off',
'ts/ban-ts-comment': 'off', // TODO: remove this
'ts/consistent-type-definitions': 'off',
'ts/method-signature-style': 'off', // TODO: remove this
'ts/no-non-null-asserted-optional-chain': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/prefer-includes': 'off', // TODO: remove this

2
typings/jest.d.ts vendored
View File

@@ -1,5 +1,5 @@
declare namespace jest {
interface Matchers<R> {
toHaveNoViolations(): R;
toHaveNoViolations: () => R;
}
}