Skip to content

Empty line not preserved before leading ; with no-semi #1510

@AnimiVulpis

Description

@AnimiVulpis

There seem to be cases in which a single prettier run is not sufficient. A second run will change the already formatted file again. After the second run no more formatting will happen.

Prettier 1.10.2
Playground link

--no-semi

Input:

a;

[].b();

Output:

a

;[].b()

Second Output:

a
;[].b()

Note the removed line.

I assumed 🤔 that prettier formatting is idempotent. Am I wrong 🙇 or is this a bug?

The only important option seems to be semi: false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:idempotencyIssues with re-printing Prettier’s outputarea:no-semidifficulty:hardIssues that might take an entire weekend, or require a tough decision to fixlang:javascriptIssues affecting JS

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions