Skip to content

deno fmt: ternary expression inside tagged template literal #29164

Closed
@mb21

Description

@mb21
export const Layout = (props: Props) => html`
  <html>
    <body>
      ${props.title.endsWith("example")
        ? html`
            <a href="/">Reactive Mastro examples</a>
            <h1>${props.title}</h1>
            `
        : ""}
      <main>${props.children}</main>
    </body>
  </html>
  `;

formats as follows in deno 2.3.1:

export const Layout = (props: Props) =>
  html`
    <html>
      <body>
        ${props.title.endsWith("example")
      ? html`
        <a href="/">Reactive Mastro examples</a>
        <h1>${props.title}</h1>
      `
      : ""}
        <main>${props.children}</main>
      </body>
    </html>
  `;

Notice how the ternary expression is indented too little.

Metadata

Metadata

Assignees

Labels

deno fmtRelated to the "deno fmt" subcommand or dprint

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions