Skip to content

Commit

Permalink
Fix: ensure that executeOnVueComponent is called after object instead…
Browse files Browse the repository at this point in the history
… of before. (fixes #173)(#175)
  • Loading branch information
armano2 authored and mysticatea committed Sep 7, 2017
1 parent 1c827b3 commit 827aaf9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ module.exports = {
}

return {
ObjectExpression (node) {
'ObjectExpression:exit' (node) {
if (!componentComments.some(el => el.loc.end.line === node.loc.start.line - 1) || isDuplicateNode(node)) return
cb(node)
},
Expand Down
19 changes: 19 additions & 0 deletions tests/lib/rules/return-in-computed-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,25 @@ ruleTester.run('return-in-computed-property', rule, {
message: 'Expected to return a value in "foo" computed property.',
line: 4
}]
},
{
filename: 'test.js',
code: `
// @vue/component
export default {
computed: {
my_FALSE_test() {
let aa = 2;
this.my_id = aa;
}
}
}
`,
parserOptions,
errors: [{
message: 'Expected to return a value in "my_FALSE_test" computed property.',
line: 5
}]
}
]
})

0 comments on commit 827aaf9

Please sign in to comment.