Repository navigation
v5.18.0
Minor Changes
-
6f82a36Thanks @DylanPiercey! - Readdeleteas a prefix operator, liketypeofandvoid, so<div a=delete x.y/>is one attribute value and a statement ending indeletecontinues onto the next line. -
6f82a36Thanks @DylanPiercey! - An empty placeholder (${}) now stops at its error instead of also emitting anonPlaceholderwhose end is past the input. -
#256
ac8fa1cThanks @DylanPiercey! - Export./package.json, so tools can read which parser version they run on withrequire("htmljs-parser/package.json"). -
#254
0602e70Thanks @DylanPiercey! - Read atype,interfaceordeclarescriptlet as a type, as statements already are, so$ type H = () => voidor$ type A = B<C>no longer swallows the next line;$ type = xstays JavaScript. A statement also finds its type keyword after extra whitespace (static type F = () => void), andisValidScriptletmatches the parser. -
#255
278f259Thanks @DylanPiercey! - A keyword operator directly after a spread's...is an operator, so<div ...new Attrs()/>is one spread rather than...newplus an attributeAttrs(). A run of non-null assertions (x!!) and one after a string or template literal ("s"!,`s`!) now ends an unenclosed value likex!does. -
6f82a36Thanks @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 valuex! id="a", and<div title=x!/>no longer fails as an unterminated regular expression. -
6f82a36Thanks @DylanPiercey! - End a type at a line-finalvoid. A type statement such asexport type H = () => voidcarried on into the next line, and avoidreturn type before{(function foo(): void {) read the body as a type;voidinside a type is now always thevoidtype rather than a prefix operator. -
6f82a36Thanks @DylanPiercey! -isValidStatementnow reads a statement starting withtype,interfaceordeclareas a type, as the parser does, so a multi-line type argument list isenclosedand a type followed by an unindented line isinvalid.