TypeScript/tests/cases/fourslash/codeFixAddVoidToPromiseJS.4.ts
Ron Buckton dba042d7d5
Add quick fix to add 'void' to Promise resolved without value (#40558)
* Add codefix to add 'void' to Promise resolved without value

* Add specific error message in checker to reduce quick-fix time in editor
2020-09-14 19:12:33 -07:00

17 lines
526 B
TypeScript

/// <reference path='fourslash.ts' />
// @target: esnext
// @lib: es2015
// @strict: true
// @allowJS: true
// @checkJS: true
// @filename: main.js
////const p4 = /** @type {Promise<{ x: number } & { y: string }>} */(new Promise(resolve => resolve()));
verify.codeFix({
errorCode: 2794,
description: "Add 'void' to Promise resolved without a value",
index: 2,
newFileContent: `const p4 = /** @type {Promise<({ x: number } & { y: string }) | void>} */(new Promise(resolve => resolve()));`
});