mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-25 05:29:07 -05:00
fix(48191): Duplicates comments on "Add definite assignment assertion to property" (#48299)
* Suppress leading and trailing comments for adding missing definite assignment assertion action * Suppress leading and trailing comments for adding missing initalizer action * Test for initializer property action
This commit is contained in:
@@ -67,6 +67,7 @@ namespace ts.codefix {
|
||||
}
|
||||
|
||||
function addDefiniteAssignmentAssertion(changeTracker: textChanges.ChangeTracker, propertyDeclarationSourceFile: SourceFile, propertyDeclaration: PropertyDeclaration): void {
|
||||
suppressLeadingAndTrailingTrivia(propertyDeclaration);
|
||||
const property = factory.updatePropertyDeclaration(
|
||||
propertyDeclaration,
|
||||
propertyDeclaration.decorators,
|
||||
@@ -108,6 +109,7 @@ namespace ts.codefix {
|
||||
}
|
||||
|
||||
function addInitializer(changeTracker: textChanges.ChangeTracker, propertyDeclarationSourceFile: SourceFile, propertyDeclaration: PropertyDeclaration, initializer: Expression): void {
|
||||
suppressLeadingAndTrailingTrivia(propertyDeclaration);
|
||||
const property = factory.updatePropertyDeclaration(
|
||||
propertyDeclaration,
|
||||
propertyDeclaration.decorators,
|
||||
|
||||
Reference in New Issue
Block a user