A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Microsoft/tslint-microsoft-contrib/issues/34 below:

All paths in functions should resolve or reject a Promise · Issue #34 · microsoft/tslint-microsoft-contrib · GitHub

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

Description

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

Development

No branches or pull requests Issue actions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4