Skip to content

Commit 4ab0ba8

Browse files
committed
refactor: use parserServices.getDocumentFragment
1 parent e588bdf commit 4ab0ba8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: lib/rules/no-empty-component-block.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,11 @@ module.exports = {
4747
* @returns {RuleListener} AST event handlers.
4848
*/
4949
create(context) {
50+
const componentBlocks = context.parserServices.getDocumentFragment()
51+
.children
52+
5053
return {
5154
Program(node) {
52-
if (!node.templateBody) {
53-
return
54-
}
55-
56-
const componentBlocks = node.templateBody.parent.children
57-
5855
for (const componentBlock of componentBlocks) {
5956
if (
6057
componentBlock.name !== 'template' &&

0 commit comments

Comments
 (0)