Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): [promise-function-async] Allow async function getter/setter #820

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/eslint-plugin/src/rules/promise-function-async.ts
Expand Up @@ -102,6 +102,10 @@ export default util.createRule<Options, MessageIds>({
return;
}

if (node.parent && node.parent.type === 'Property') {
bradzacher marked this conversation as resolved.
Show resolved Hide resolved
return;
}

context.report({
messageId: 'missingAsync',
node,
Expand Down
Expand Up @@ -63,6 +63,12 @@ const invalidAsyncModifiers = {
},
set asyncGetter(p: Promise<void>) {
return p;
},
get asyncGetterFunc() {
return async () => new Promise<void>();
},
set asyncGetterFunc(p: () => Promise<void>) {
return p;
}
}
`,
Expand Down