Skip to content

TypeScript: Function declaration not wrapped with nullable parameter #2002

@unstubbable

Description

@unstubbable

Input

export function aPrettyLongFunction(aRatherLongParamName: string | null): string[] {}

Expected Output

export function aPrettyLongFunction(
  aRatherLongParamName: string | null
): string[] {}

Actual Output

export function aPrettyLongFunction(aRatherLongParamName: string | null): string[] {}

(interactive example)


Note that wrapping works when you replace null with number for example:

Input

export function aPrettyLongFunction(aRatherLongParamName: string | number): string[] {}

Correct Output

export function aPrettyLongFunction(
  aRatherLongParamName: string | number
): string[] {}

(interactive example)

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions