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

Unstable formatting behaviour #670

Open
lucacasonato opened this issue Sep 18, 2024 · 1 comment
Open

Unstable formatting behaviour #670

lucacasonato opened this issue Sep 18, 2024 · 1 comment

Comments

@lucacasonato
Copy link
Contributor

Describe the bug

The provided code requires two passes through the formatter before it reaches a stable format result.

First formatting: https://dprint.dev/playground/#code/GYVwdgxgLglg9mABMOcAUBKRBvAUI5OAJ0TQBsBTKRGRAXkQAYBuGxAHkQCMQooEAwnHBRWMANTis2REQCGYAOYUAdFAoAPKGhhq4AZShEYSzABpS0DVjoA+RFZVEKABzIBPNAAMAJNhgAvogAzhSU0BQAJl4YGMz4iAG4SUA/plugin/typescript
Second formatting: https://dprint.dev/playground/#code/GYVwdgxgLglg9mABMOcAUBKRBvAUI5OAJ0TQBsBTKRGRAXkQAYBuGxAHkQCMQooEAwnHBRWMANTiseAgSIBDMAHMKAOigUAHlDQx1cAMpQiMZZgA0paJqx0AfPlkFrqohQAOZAJ5oABgBJsGABfRABnCkpoCgATXwwMZkdg3BSgA/plugin/typescript

dprint-plugin-typescript version: 0.92.0

Input Code

function foo() {
  for (let i = 0; i < buttonCount; i++) { range.text(i.toString(), (ctx) => ctx.reply(`${i} selected`));
  }
}

Expected Output

function foo() {
  for (let i = 0; i < buttonCount; i++) {
    range.text(i.toString(), (ctx) => ctx.reply(`${i} selected`));
  }
}

Actual Output

function foo() {
  for (let i = 0; i < buttonCount; i++) {
    range.text(i.toString(), (ctx) =>
      ctx.reply(`${i} selected`));
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants