fix: Cypress.Commands.add Type Signature for @typescript-eslint/no-misused-promises rule (#7547)

This commit is contained in:
Kukhyeon Heo
2020-06-09 22:42:27 +09:00
committed by GitHub
parent eed4934885
commit d0043ff4fd
3 changed files with 21 additions and 3 deletions
+5 -3
View File
@@ -355,9 +355,9 @@ declare namespace Cypress {
* @see https://on.cypress.io/api/commands
*/
Commands: {
add(name: string, fn: (...args: any[]) => void): void
add(name: string, options: CommandOptions, fn: (...args: any[]) => void): void
overwrite(name: string, fn: (...args: any[]) => void): void
add(name: string, fn: (...args: any[]) => CanReturnChainable): void
add(name: string, options: CommandOptions, fn: (...args: any[]) => CanReturnChainable): void
overwrite(name: string, fn: (...args: any[]) => CanReturnChainable): void
}
/**
@@ -491,6 +491,8 @@ declare namespace Cypress {
off: Actions
}
type CanReturnChainable = void | Chainable
/**
* Chainable interface for non-array Subjects
*/