@@ -12,13 +12,10 @@ import type { RuleContext, RuleListener } from '../types'
12
12
const debug = debugBuilder ( 'eslint-plugin-vue-i18n:no-html-messages' )
13
13
14
14
function findHTMLNode (
15
- node : parse5 . DefaultTreeDocumentFragment
16
- ) : parse5 . DefaultTreeElement | undefined {
17
- return node . childNodes . find ( ( child ) : child is parse5 . DefaultTreeElement => {
18
- if (
19
- child . nodeName !== '#text' &&
20
- ( child as parse5 . DefaultTreeElement ) . tagName
21
- ) {
15
+ node : parse5 . DocumentFragment
16
+ ) : parse5 . Element | undefined {
17
+ return node . childNodes . find ( ( child ) : child is parse5 . Element => {
18
+ if ( child . nodeName !== '#text' && ( child as parse5 . Element ) . tagName ) {
22
19
return true
23
20
}
24
21
return false
@@ -38,7 +35,7 @@ function create(context: RuleContext): RuleListener {
38
35
}
39
36
const htmlNode = parse5 . parseFragment ( `${ node . value } ` , {
40
37
sourceCodeLocationInfo : true
41
- } ) as parse5 . DefaultTreeDocumentFragment
38
+ } ) as parse5 . DocumentFragment
42
39
const foundNode = findHTMLNode ( htmlNode )
43
40
if ( ! foundNode ) {
44
41
return
@@ -66,7 +63,7 @@ function create(context: RuleContext): RuleListener {
66
63
}
67
64
const htmlNode = parse5 . parseFragment ( `${ node . value } ` , {
68
65
sourceCodeLocationInfo : true
69
- } ) as parse5 . DefaultTreeDocumentFragment
66
+ } ) as parse5 . DocumentFragment
70
67
const foundNode = findHTMLNode ( htmlNode )
71
68
if ( ! foundNode ) {
72
69
return
0 commit comments