Skip to content

v5.18.0

Choose a tag to compare

@github-actions github-actions released this 28 Sep 16:48
· 5 commits to main since this release

Minor Changes

  • 6f82a36 Thanks @DylanPiercey! - Read delete as a prefix operator, like typeof and void, so <div a=delete x.y/> is one attribute value and a statement ending in delete continues onto the next line.

  • 6f82a36 Thanks @DylanPiercey! - An empty placeholder (${}) now stops at its error instead of also emitting an onPlaceholder whose end is past the input.

  • #256 ac8fa1c Thanks @DylanPiercey! - Export ./package.json, so tools can read which parser version they run on with require("htmljs-parser/package.json").

  • #254 0602e70 Thanks @DylanPiercey! - Read a type, interface or declare scriptlet as a type, as statements already are, so $ type H = () => void or $ type A = B<C> no longer swallows the next line; $ type = x stays JavaScript. A statement also finds its type keyword after extra whitespace (static type F = () => void), and isValidScriptlet matches the parser.

  • #255 278f259 Thanks @DylanPiercey! - A keyword operator directly after a spread's ... is an operator, so <div ...new Attrs()/> is one spread rather than ...new plus an attribute Attrs(). A run of non-null assertions (x!!) and one after a string or template literal ("s"!, `s`!) now ends an unenclosed value like x! does.

  • 6f82a36 Thanks @DylanPiercey! - Treat a trailing TypeScript non-null assertion directly after an operand (x!, f()!, a[0]!) as postfix, so it ends an unenclosed attribute, tag variable or statement value. <div title=x! id="a"/> now reports two attributes rather than one value x! id="a", and <div title=x!/> no longer fails as an unterminated regular expression.

  • 6f82a36 Thanks @DylanPiercey! - End a type at a line-final void. A type statement such as export type H = () => void carried on into the next line, and a void return type before { (function foo(): void {) read the body as a type; void inside a type is now always the void type rather than a prefix operator.

  • 6f82a36 Thanks @DylanPiercey! - isValidStatement now reads a statement starting with type , interface or declare as a type, as the parser does, so a multi-line type argument list is enclosed and a type followed by an unindented line is invalid.