Skip to content

Removes blank line between last member and trailing comment in an object #761

@akriegman

Description

@akriegman

Describe the bug

If I leave a blank line between the last member of an object and a trailing comment, then dprint removes the line. It does not do this with other blank lines between members and comments, so I think this is probably a bug.

dprint-plugin-typescript version: 0.95.13

Input Code

const obj = {
  // leading comment

  a: 1,

  // interior comment

  b: 2,

  // trailing comment
};

Expected Output

const obj = {
  // leading comment

  a: 1,

  // interior comment

  b: 2,

  // trailing comment
};

Actual Output

const obj = {
  // leading comment

  a: 1,

  // interior comment

  b: 2,
  // trailing comment
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions