dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

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

Open akriegman opened this issue 1 month ago • 0 comments

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
};

akriegman avatar Dec 09 '25 06:12 akriegman