66import assert from "assert"
77import last from "lodash/last"
88import findLastIndex from "lodash/findLastIndex"
9- import {
9+ import type {
1010 ErrorCode ,
1111 HasLocation ,
1212 Namespace ,
13- NS ,
14- ParseError ,
1513 Token ,
1614 VAttribute ,
1715 VDocumentFragment ,
1816 VElement ,
1917 VExpressionContainer ,
2018} from "../ast"
19+ import { NS , ParseError } from "../ast"
2120import { debug } from "../common/debug"
2221import { LocationCalculator } from "../common/location-calculator"
2322import {
@@ -37,16 +36,17 @@ import {
3736 HTML_VOID_ELEMENT_TAGS ,
3837 SVG_ELEMENT_NAME_MAP ,
3938} from "./util/tag-names"
40- import {
39+ import type {
4140 IntermediateToken ,
42- IntermediateTokenizer ,
4341 EndTag ,
4442 Mustache ,
4543 StartTag ,
4644 Text ,
4745} from "./intermediate-tokenizer"
48- import { Tokenizer } from "./tokenizer"
49- import { isSFCFile , ParserOptions } from "../common/parser-options"
46+ import { IntermediateTokenizer } from "./intermediate-tokenizer"
47+ import type { Tokenizer } from "./tokenizer"
48+ import type { ParserOptions } from "../common/parser-options"
49+ import { isSFCFile } from "../common/parser-options"
5050
5151const DIRECTIVE_NAME = / ^ (?: v - | [ . : @ # ] ) .* [ ^ . : @ # ] $ / u
5252const DT_DD = / ^ d [ d t ] $ / u
@@ -83,7 +83,7 @@ function isHTMLIntegrationPoint(element: VElement): boolean {
8383 return (
8484 element . name === "annotation-xml" &&
8585 element . startTag . attributes . some (
86- a =>
86+ ( a ) =>
8787 a . directive === false &&
8888 a . key . name === "encoding" &&
8989 a . value != null &&
@@ -358,7 +358,7 @@ export class Parser {
358358 }
359359
360360 if ( name === "template" ) {
361- const xmlns = token . attributes . find ( a => a . key . name === "xmlns" )
361+ const xmlns = token . attributes . find ( ( a ) => a . key . name === "xmlns" )
362362 const value = xmlns && xmlns . value && xmlns . value . value
363363
364364 if ( value === NS . HTML || value === NS . MathML || value === NS . SVG ) {
@@ -462,7 +462,7 @@ export class Parser {
462462 }
463463 const hasVPre =
464464 ! this . isInVPreElement &&
465- token . attributes . some ( a => a . key . name === "v-pre" )
465+ token . attributes . some ( ( a ) => a . key . name === "v-pre" )
466466
467467 // Disable expression if v-pre
468468 if ( hasVPre ) {
@@ -520,7 +520,7 @@ export class Parser {
520520 if ( namespace === NS . HTML ) {
521521 if ( element . parent . type === "VDocumentFragment" ) {
522522 const langAttr = element . startTag . attributes . find (
523- a => ! a . directive && a . key . name === "lang" ,
523+ ( a ) => ! a . directive && a . key . name === "lang" ,
524524 ) as VAttribute | undefined
525525 const lang = langAttr ?. value ?. value
526526
@@ -565,7 +565,7 @@ export class Parser {
565565
566566 const i = findLastIndex (
567567 this . elementStack ,
568- el => el . name . toLowerCase ( ) === token . name ,
568+ ( el ) => el . name . toLowerCase ( ) === token . name ,
569569 )
570570 if ( i === - 1 ) {
571571 this . reportParseError ( token , "x-invalid-end-tag" )
0 commit comments