Skip to content

Formatting changing type of hash key #419

Open
@andypearson

Description

@andypearson

I've just upgraded to syntax_tree version 6.2.0.

Formatting with Prettier is now changing:

basket_id = 123
total = 10

{ "basket.id": basket_id, total: }

In to:

basket_id = 123
total = 10

{ "basket.id" => basket_id, total: }

Note the "basket.id" key is changing from a symbol in to a string, causing some test assertions to fail.

It seems to be something to do with the shorthand hash syntax. The following does not change when formatted:

basket_id = 123
total = 10

{ "basket.id": basket_id, total: total }

Let me know if you need any more details, of if this needs to be addressed at the Prettier side, I'm unclear how the two interact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions