Skip to content

Commit 827aaf9

Browse files
armano2mysticatea
authored andcommitted
Fix: ensure that executeOnVueComponent is called after object instead of before. (fixes #173)(#175)
1 parent 1c827b3 commit 827aaf9

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

lib/utils/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ module.exports = {
457457
}
458458

459459
return {
460-
ObjectExpression (node) {
460+
'ObjectExpression:exit' (node) {
461461
if (!componentComments.some(el => el.loc.end.line === node.loc.start.line - 1) || isDuplicateNode(node)) return
462462
cb(node)
463463
},

tests/lib/rules/return-in-computed-property.js

+19
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,25 @@ ruleTester.run('return-in-computed-property', rule, {
237237
message: 'Expected to return a value in "foo" computed property.',
238238
line: 4
239239
}]
240+
},
241+
{
242+
filename: 'test.js',
243+
code: `
244+
// @vue/component
245+
export default {
246+
computed: {
247+
my_FALSE_test() {
248+
let aa = 2;
249+
this.my_id = aa;
250+
}
251+
}
252+
}
253+
`,
254+
parserOptions,
255+
errors: [{
256+
message: 'Expected to return a value in "my_FALSE_test" computed property.',
257+
line: 5
258+
}]
240259
}
241260
]
242261
})

0 commit comments

Comments
 (0)