diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index 225b2bd8367..8ec816b456b 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -103,6 +103,14 @@ export default util.createRule({ return; } + if ( + node.parent && + node.parent.type === 'Property' && + (node.parent.kind === 'get' || node.parent.kind === 'set') + ) { + return; + } + context.report({ messageId: 'missingAsync', node, diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts index 829bb9a091c..ed798ca18e2 100644 --- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts +++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts @@ -63,6 +63,12 @@ const invalidAsyncModifiers = { }, set asyncGetter(p: Promise) { return p; + }, + get asyncGetterFunc() { + return async () => new Promise(); + }, + set asyncGetterFunc(p: () => Promise) { + return p; } } `,