Skip to content

Commit 76695d0

Browse files
committed
Remove yield/generator from this rule.
1 parent aa17e77 commit 76695d0

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

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

-16
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ function create (context) {
6161
const expressionTypes = {
6262
promise: 'asynchronous action',
6363
await: 'await operator',
64-
yield: 'yield keyword',
65-
generator: 'generator function expression',
6664
async: 'async function declaration',
6765
new: 'Promise object',
6866
timed: 'timed function'
@@ -75,12 +73,6 @@ function create (context) {
7573
type: 'async'
7674
})
7775
}
78-
if (node.generator) {
79-
forbiddenNodes.push({
80-
node: node,
81-
type: 'generator'
82-
})
83-
}
8476
}
8577

8678
return Object.assign({},
@@ -115,14 +107,6 @@ function create (context) {
115107
}
116108
},
117109

118-
YieldExpression (node) {
119-
// await nodes are YieldExpression's with babel-eslint < 7.0.0
120-
forbiddenNodes.push({
121-
node: node,
122-
type: 'yield'
123-
})
124-
},
125-
126110
AwaitExpression (node) {
127111
forbiddenNodes.push({
128112
node: node,

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

-24
Original file line numberDiff line numberDiff line change
@@ -296,30 +296,6 @@ ruleTester.run('no-async-in-computed-properties', rule, {
296296
line: 6
297297
}]
298298
},
299-
{
300-
filename: 'test.vue',
301-
code: `
302-
export default {
303-
computed: {
304-
foo: function* () {
305-
yield 1
306-
yield* g1()
307-
}
308-
}
309-
}
310-
`,
311-
parserOptions,
312-
errors: [{
313-
message: 'Unexpected generator function expression in "foo" computed property.',
314-
line: 4
315-
}, {
316-
message: 'Unexpected yield keyword in "foo" computed property.',
317-
line: 5
318-
}, {
319-
message: 'Unexpected yield keyword in "foo" computed property.',
320-
line: 6
321-
}]
322-
},
323299
{
324300
filename: 'test.vue',
325301
code: `

0 commit comments

Comments
 (0)