Recast version: 0.20.5
Node version: 14.18.2
Mac OS X version: 12.0.1
Repro: https://github.com/lokshunhung/recast-definite-repro
AST explorer
recast with recast/parser/typescript can remove definite assignment assertions for class properties by setting ClassProperty.definite = false (originally true)
// Before
class A {
foo!: string;
}
// After
class A {
foo: string;
}
but cannot add definite assignment assertions for class properties by setting ClassProperty.definite = true (originally undefined)
// Before
class A {
foo: string;
}
// After
class A {
foo: string;
}
// should be `foo!: string;`