Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Inconsistent multiline printing of record types and values #7961

Open
Labels
formatterIssues related to code formatting
@cknitt

Description

@cknitt

Comparing ReScript's behavior to Prettier's, Prettier is consistent for types and values, but ReScript is not.

My proposal is tostandardize on Prettier's behavior, also because it seems to follow user intention better. If the user put the first record field on a separate line, we may assume that they intend to keep the formatting multiline and/or add more fields later.

Prettier

Types

typeX={a:number};typeY={a:number};typeZ={a:number};

reformats to

typeX={a:number};typeY={a:number};typeZ={a:number;};

Values

letx={a:2};letx={a:2,};letx={a:2,};

reformats to

letx={a:2};letx={a:2};letx={a:2,};

ReScript

Types

typex= {a:int}typey= {a:int}typez= {a:int,}

reformats to

type x = {a: int}type y = {a: int}type z = {a: int}

Values

letx= {a:2}letx= {a:2}letx= {a:2}

reformats to

let x = {a: 2}let x = {  a: 2,}let x = {  a: 2,}

Metadata

Metadata

Assignees

No one assigned

    Labels

    formatterIssues related to code formatting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp