Skip to content

Result.combine() with Result<void, E>[] is typed as Result<void[], E>, which when explicitly typed is incompatible with @typescript-eslint/no-invalid-void-type #675

@FunctionDJ

Description

@FunctionDJ

Minimalistic example:

const foo = (): Result<void[], Error> => Result.combine([ok()]);

For context, a slightly more real-world-usage example:

declare const doSomething: () => Result<void, Error>;

const foo = (): Result<void[], Error> => Result.combine([1, 2, 3].map(() => doSomething()));

Both examples are typed correctly but violate the typescript-eslint rule because I assume the rule considers void[] not to be a useful type and instead usually a code smell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions