Skip to content

Bad formatting for default generic type arguments in type declarations #26656

@AlCalzone

Description

@AlCalzone

TypeScript Version: 3.1.0-dev.20180824

Search Terms: tuple generic space

Code
Format this:

type Foo<
	T1 extends any[],
	T2 extends any[] = []
> = T1 & T2;

Expected behavior:
Either no change or the following, although I would prefer no indentation on the last line to be consistent with curly braces and object literals:

type Foo<
	T1 extends any[],
	T2 extends any[] = []
	> = T1 & T2;

Actual behavior:

type Foo<
	T1 extends any[],
	T2 extends any[]=[] // <= TSLint complains about missing whitespace
	> = T1 & T2;

Related Issues: none found

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions