Skip to content

Commit

Permalink
fix(eslint-plugin): [pfa] Allow async getter/setter in classes (#980)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottohara authored and bradzacher committed Sep 17, 2019
1 parent fa1cf71 commit e348cb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/eslint-plugin/src/rules/promise-function-async.ts
Expand Up @@ -105,7 +105,8 @@ export default util.createRule<Options, MessageIds>({

if (
node.parent &&
node.parent.type === 'Property' &&
(node.parent.type === 'Property' ||
node.parent.type === 'MethodDefinition') &&
(node.parent.kind === 'get' || node.parent.kind === 'set')
) {
return;
Expand Down
Expand Up @@ -54,6 +54,12 @@ class InvalidAsyncModifiers {
public set asyncGetter(p: Promise<void>) {
return p;
}
public get asyncGetterFunc() {
return async () => new Promise<void>();
}
public set asyncGetterFunc(p: () => Promise<void>) {
return p;
}
}
`,
`
Expand Down

0 comments on commit e348cb2

Please sign in to comment.