Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

New Rule: All paths in functions should resolve or reject a Promise #34

@HamletDRC

Description

@HamletDRC

This is very similar to #26 (#26)

This code is OK because all paths resolve or reject:

function myMethod() : Promise<void> {
    return new Promise<void>((resolve, reject) => {
        if (something) {
            resolve()
        } else {
            reject();
        }
    });
}

This code creates a violation because not all paths resolve/reject:

function myMethod() : Promise<void> {
    return new Promise<void>((resolve, reject) => {
        if (something) {
            resolve()
        }
    });
}

All of the rules for scope, variable shadowing, and type limitations apply from #26

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions