TypeScript/tests/cases/fourslash/codeFixClassPropertyInitialization1.ts
Wenlu Wang 30a96ba335 add support of codefix for Strict Class Initialization (#21528)
* add support of add undefined type to propertyDeclaration

* add support of add Definite Assignment Assertions to propertyDeclaration

* add support of add Initializer to propertyDeclaration

* remove useless parameter

* fix PropertyDeclaration emit missing exclamationToken

* merge fixes and fix

* fix unnecessary type assert
2018-02-23 07:25:50 -08:00

15 lines
251 B
TypeScript

/// <reference path='fourslash.ts' />
// @strict: true
//// class T {
//// a: string;
//// }
verify.codeFix({
description: `Add 'undefined' type to property 'a'`,
newFileContent: `class T {
a: string | undefined;
}`,
index: 0
})