Skip to content

consistent-return and promises #548

Description

@olalonde

I kind of like the consistent-return rule except when using promises. I often find myself writing this style of code:

const something = () => {
    return somePromise().then((someval) => {
      if (!someval) return;
      return someOtherPromise();
   });
};

What should I put as return value in the first return? return null fixes the

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions