Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments at the end of objects have their preceding newlines removed #34

Open
jakebailey opened this issue Apr 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jakebailey
Copy link

Describe the bug

Comments at the end of objects have their preceding newlines removed; this is awkward in config files where I'm commenting out a setting at the bottom of an object temporarily, as it removes the formatting I had there for spacing.

dprint-plugin-json version: 0.19.2

Input Code

{
  // This is a setting.
  "foo": "",

  // These settings are temporarily commented out.
  // "baz": "",
  // "qux": ""
}

Expected Output

{
  // This is a setting.
  "foo": ""

  // These settings are temporarily commented out.
  // "baz": "",
  // "qux": ""
}

Actual Output

{
  // This is a setting.
  "foo": ""
  // These settings are temporarily commented out.
  // "baz": "",
  // "qux": ""
}
@dsherret dsherret added the bug Something isn't working label Apr 3, 2024
@jakebailey
Copy link
Author

(Obviously the header for the second I had was not // These settings are temporarily commented out., but something related to my vscode settings 😄)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants