Skip to content

Commit b1d17ed

Browse files
committed
fix/merge changes with master
1 parent 2d15606 commit b1d17ed

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Diff for: lib/rules/no-template-shadow.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = {
3838
// Public
3939
// ----------------------------------------------------------------------
4040

41-
utils.registerTemplateBodyVisitor(context, {
41+
return utils.defineTemplateBodyVisitor(context, {
4242
VElement (node) {
4343
scope = {
4444
parent: scope,
@@ -66,13 +66,11 @@ module.exports = {
6666
'VElement:exit' (node) {
6767
scope = scope.parent
6868
}
69-
})
70-
71-
return utils.executeOnVue(context, (obj) => {
69+
}, utils.executeOnVue(context, (obj) => {
7270
const properties = Array.from(utils.iterateProperties(obj, new Set(GROUP_NAMES)))
7371
for (const node of properties) {
7472
jsVars.add(node.name)
7573
}
76-
})
74+
}))
7775
}
7876
}

Diff for: lib/utils/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
*
2727
* @param {RuleContext} context The rule context to use parser services.
2828
* @param {Object} templateBodyVisitor The visitor to traverse the template body.
29-
* @param {Object} scriptVisitor The visitor to traverse the script.
29+
* @param {Object} [scriptVisitor] The visitor to traverse the script.
3030
* @returns {Object} The merged visitor.
3131
*/
3232
defineTemplateBodyVisitor (context, templateBodyVisitor, scriptVisitor) {

Diff for: tests/lib/rules/no-template-shadow.js

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ ruleTester.run('no-template-shadow', rule, {
3131
'<template><div v-for="i in 5"></div></template>',
3232
'<template><div v-for="i in 5"><div v-for="b in 5"></div></div></template>',
3333
'<template><div v-for="i in 5"></div><div v-for="i in 5"></div></template>',
34+
'<template> <ul v-for="i in 5"> <li> <span v-for="j in 10">{{i}},{{j}}</span> </li> </ul> </template>',
3435
{
3536
filename: 'test.vue',
3637
code: `<template>

0 commit comments

Comments
 (0)