Skip to content

Commit 3a4b4be

Browse files
committed
Fix issue with only geter in computed property witchout seter
1 parent a38e002 commit 3a4b4be

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/utils/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,6 @@ module.exports = {
349349
}
350350

351351
return { key, value }
352-
})
352+
}).filter(cp => cp.value)
353353
}
354354
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@ ruleTester.run('no-async-in-computed-properties', rule, {
3434
} finally {
3535
return bar
3636
}
37+
},
38+
foo2: {
39+
get () {
40+
new Promise((resolve, reject) => {})
41+
}
3742
}
3843
}
3944
}
4045
`,
41-
parserOptions: { ecmaVersion: 6, sourceType: 'module' }
46+
parserOptions: { ecmaVersion: 8, sourceType: 'module' }
4247
}
4348
],
4449

0 commit comments

Comments
 (0)