Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Address 2637: Relax promise-function-async for short arrow functions #4553

Merged
merged 2 commits into from Mar 2, 2019
Merged

Address 2637: Relax promise-function-async for short arrow functions #4553

merged 2 commits into from Mar 2, 2019

Conversation

rrogowski
Copy link
Contributor

@rrogowski rrogowski commented Feb 27, 2019

PR checklist

Overview of change:

Single statement lamda functions that delegate to another promise-returning function are allowed.

Configuration

{
  "rules": {
    "promise-function-async": true
  }
}

Before

public async asyncPromiseMethodB() {
    return new Promise<void>();
}

public delegatingMethod = () => this.asyncPromiseMethodB(1);
                          ~~~~~ [functions that return promises must be async]

After

public async asyncPromiseMethodB() {
    return new Promise<void>();
}

public delegatingMethod = () => this.asyncPromiseMethodB(1);
                          // No lint error

CHANGELOG.md entry:

[enhancement] promise-function-async now allows single statement lamda functions that delegate to another promise-returning function

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @rrogowski! 🙌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relax promise-function-async for short arrow functions
2 participants