Skip to content

Commit 46be810

Browse files
fix: used sourceCode.parserServices
1 parent 4d04a96 commit 46be810

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/util/parser.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
* @returns
77
*/
88
function defineTemplateBodyVisitor(context, templateBodyVisitor, scriptVisitor) {
9-
if (context.parserServices == null || context.parserServices.defineTemplateBodyVisitor == null) {
9+
if (
10+
context.sourceCode.parserServices == null ||
11+
context.sourceCode.parserServices.defineTemplateBodyVisitor == null
12+
) {
1013
// Default parser
1114
return scriptVisitor;
1215
}
1316

1417
// Using "vue-eslint-parser" requires this setup
1518
// @see https://eslint.org/docs/developer-guide/working-with-rules#the-context-object
16-
return context.parserServices.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
19+
return context.sourceCode.parserServices.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor);
1720
}
1821

1922
module.exports = {

0 commit comments

Comments
 (0)