dprint / dprint-plugin-typescript

TypeScript and JavaScript code formatting plugin for dprint.
https://dprint.dev/plugins/typescript
MIT License
255 stars 57 forks source link

bracePosition: nextLine does not work when passing objects as arguments #611

Open stevenh-gh opened 7 months ago

stevenh-gh commented 7 months ago

Describe the bug Unsure if this is an intended feature or not, but passing objects as arguments, for example fetch or json stringify, the braces stay on the same line instead of moving down to the next line (and the same for the braces of nested objects).

dprint-plugin-typescript version: 0.88.10

Input Code

fetch('some/api/', {
  method: 'delete'
});

Expected Output

fetch('some/api/',
{
  method: 'delete'
});

Actual Output

fetch('some/api/', {
  method: 'delete'
});

Input Code

JSON.stringify({
  name: name
})

Expected Output

JSON.stringify(
{
  name: name
})

Actual Output

JSON.stringify({
  name: name
})