Skip to content

Incorrect formatting in fluent API call  #14675

Closed
@magnushiie

Description

@magnushiie

TypeScript Version: 2.2.1

Code

Format the following code snippet using VS Code or typescript-formatter:

someVar
  .chain(
    'arg1',
    'arg2',
  )
  .chain(
    3,
    4,
  );

Expected behavior:

someVar
  .chain(
    'arg1',
    'arg2',
  )
  .chain(
    3,
    4,
  );

Actual behavior:

someVar
  .chain(
  'arg1',
  'arg2',
)
  .chain(
  3,
  4,
);

This is a common occurrence with fluent APIs (test frameworks, ORMs, etc) and tslint rules requiring trailing comma.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: FormatterThe issue relates to the built-in formatter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions