Skip to content

Option for ignoring original formatting 100% #2068

@ccorcos

Description

@ccorcos

Edit by @lydell: Prettier currently keeps multiline object literals multiline even if they fit in a single line, and does special things to blank lines: removes some, collapses consecutive blank lines into one and never adds blank lines. This is because the majority of people seem to want this level of control since we haven’t found a super good heuristic for printing those things. Some people prefer a 100% uniform printing, though, that completely ignores original formatting, even if it sometimes results in “uglier” code. We should discuss this.

Original post:

Is it possible to have a strict option that disambiguates whitespace and always prints out the same so long as the AST is the same? I'm running into some weird issues where lines wrap and then don't unwrap when they are under the line-length limit. This would greatly help with some of my merge conflicts right now :)

P.S. I'm using typescript.

Thanks

Metadata

Metadata

Assignees

Labels

difficulty:hardIssues that might take an entire weekend, or require a tough decision to fixlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.type:option requestIssues requesting a new option. We generally don’t accept these unless there is technical necessity.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions