Skip to content
This repository was archived by the owner on Feb 12, 2019. It is now read-only.
This repository was archived by the owner on Feb 12, 2019. It is now read-only.

Discussion: Keeping previous whitespace for logically grouped code #28

@AlanFoster

Description

@AlanFoster

Consider the following JavaScript which has been input into Prettier. Note that the developer has logically grouped together certain variables with deliberate use of whitespace:

logicalGrouping1 = 10
logicalGrouping2 = 20

secondLogicalGrouping1 = 10
secondLogicalGrouping2 = 20

doSomething()

The current version of Prettier for JavaScript will still keep the logical grouping of statements when creating the updated

logicalGrouping1 = 10;
logicalGrouping2 = 20;

secondLogicalGrouping1 = 10;
secondLogicalGrouping2 = 20;

doSomething();

However, the current prettier-ruby output will currently throw away this whitespace:

logicalGrouping1 = 10
logicalGrouping2 = 20
secondLogicalGrouping1 = 10
secondLogicalGrouping2 = 20
doSomething

Discussion:

Should prettier-ruby align with a similar result to the JavaScript prettier output, and keep some whitespace intact for readability? And if so, are there any thoughts on implementation details

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrequires tokensA specific label showing dependency on https://github.com/iamsolankiamit/prettier-ruby/issues/50

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions