Skip to content

Commit f6b60db

Browse files
committed
Remove redundant check
1 parent 0c5e626 commit f6b60db

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

lib/rules/no-async-in-computed-properties.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ function isPromise (node) {
5050
node.callee.object.type === 'Identifier' &&
5151
node.callee.object.name === 'Promise' &&
5252
PROMISE_METHODS.indexOf(node.callee.property.name) !== -1
53-
) || ( // somePromise.ANYTHING()
54-
node.callee.object && isPromise(node.callee.object)
5553
)
5654
}
5755
return false

tests/lib/rules/no-async-in-computed-properties.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,25 @@ ruleTester.run('no-async-in-computed-properties', rule, {
262262
line: 6
263263
}]
264264
},
265+
{
266+
filename: 'test.vue',
267+
code: `
268+
new Vue({
269+
computed: {
270+
foo: {
271+
get () {
272+
return test.blabla.then([])
273+
}
274+
}
275+
}
276+
})
277+
`,
278+
parserOptions: { ecmaVersion: 6 },
279+
errors: [{
280+
message: 'Unexpected asynchronous action in "foo" computed property.',
281+
line: 6
282+
}]
283+
},
265284
{
266285
filename: 'test.vue',
267286
code: `

0 commit comments

Comments
 (0)