Skip to content

HTML tagged template fails silently #29217

@bartlomieju

Description

@bartlomieju

Version: Deno 2.3.1

// main.ts
const content = html`<main>
            <h1>
Hello 
<h1></main>
`;
$ deno fmt main.ts

Nothing happens.

Let's do the same thing in an HTML file:

<!-- index.html --->
<main>
            <h1>
Hello 
<h1></main>
$ deno fmt index.html
Error formatting: /Users/ib/dev/deno_v2.3_livestream/index.html
   Syntax error (expected close tag) at file:///Users/ib/dev/deno_v2.3_livestream/index.html:5:0

error: Failed to format 1 of 1 checked file

When formatting broken HTML inside JS/TS file we should raise the error too.

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