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

Make template literals more inline #691

Open
mohamedmansour opened this issue Dec 12, 2024 · 2 comments
Open

Make template literals more inline #691

mohamedmansour opened this issue Dec 12, 2024 · 2 comments

Comments

@mohamedmansour
Copy link

mohamedmansour commented Dec 12, 2024

Describe the bug

dprint version: 0.47.4

It is adding new lines for the functions within template literals. If there was a configuration to NOT add new lines for template literals function, that would be great. Or even disable formatting anything in a template literal.

Input Code

const html = html`
  <ul>
    ${when(x => x.isValid, html`
      <li>${x => x.name}</li>
    `)}
   </ul>
`;

Expected Output

const html = html`
  <ul>
    ${when(x => x.isValid, html`
      <li>${x => x.name}</li>
    `)}
   </ul>
`;

Actual Output

const html = html`
  <ul>
    ${
  when(
    x => x.isValid,
    html`
      <li>${x => x.name}</li>
    `,
  )
}
   </ul>
`;
@dsherret dsherret added the duplicate This issue or pull request already exists label Dec 15, 2024
@dsherret
Copy link
Member

Duplicate of #9

@dsherret dsherret marked this as a duplicate of #9 Dec 15, 2024
@dsherret dsherret closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2024
@dsherret
Copy link
Member

Sorry, I only looked at the title of this and not the body.

@dsherret dsherret reopened this Dec 15, 2024
@dsherret dsherret removed the duplicate This issue or pull request already exists label Dec 15, 2024
@dsherret dsherret changed the title Template Literals Formatter Make template literals more inline Dec 15, 2024
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