Skip to content

TypeScript: Comment above interface function property splits arguments across multiple lines #1976

@mafredri

Description

@mafredri

Input:

interface ScreenObject {
	// I make things weird.
	at(point: Point): Screen | undefined;
}

Output:

interface ScreenObject {
	// I make things weird.
	at(
		point: Point
	): Screen | undefined;
}

Expected:

No change from input.

Problem seems to go away if e.g. a regular property appears before the function, like this:

interface ScreenObject {
	// I make things weird.
  	prop: string;
	at(point: Point): Screen | undefined;
}

Reproduction link can be found here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)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