Skip to content

BUGS: Compiler removes inline comments for objects #17001

Closed
@microshine

Description

@microshine

TypeScript Version: 2.4.1

Code

/**
 * Comment
 */
// Comment
const val1 = 1; // comment
const val2 = 1; /* comment */

const obj = {
    prop1: 1, // comment
    prop2: 2, /* comment */
}

// Comment

Compiled JS

"use strict";
/**
 * Comment
 */
// Comment
var val1 = 1; // comment
var val2 = 1; /* comment */
var obj = {
    prop1: 1,
    prop2: 2,
};
// Comment 

TypeScript compiler removed comments after prop1 and prob2 for obj

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions