Skip to content

Prettier 1.18 breaks support for TS users < 3.3 #6197

@mattlewis92

Description

@mattlewis92

Prettier 1.18.0
Playground link

--parser typescript
--trailing-comma es5

Input:

function foo (args: [
        string,
        string,
        string,
        string,
        string,
        string,
        string,
        string,
        string,
        string,
        string
      ]) {}

Output:

function foo(
  args: [
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
  ]
) {}

Expected behavior:

According to the PR at #6172, this should only be applied when the trailing comma is all but it also gets applied when it's set to es5.

Secondly because we were on TS 3.2 (we can't upgrade get because we're on an older angular version) this broke our build as TS 3.2 can't parse the output. I think the TS version could be read by prettier and then used to determine whether to apply this transformation.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions