Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP use dprint for internal code formatting #4681

Closed
wants to merge 1 commit into from
Closed

Conversation

ry
Copy link
Member

@ry ry commented Apr 8, 2020

I'm not sure we're ready for this, but I wanted to put up my half attempt to get this working.

Problems:

  • configuration for "deno fmt" and "dprint" is now split between cli/fmt.rs and tools/dprint_config.json
  • still need prettier for json and md
  • need to update CI to install dprint binary
  • not all configurations supported via JSON (?)

@trivikr
Copy link
Contributor

trivikr commented Apr 11, 2020

As per comment #4507 (comment), two changes pending in dprint related to deno migration https://github.com/dsherret/dprint/milestone/2

"lineWidth": "80",
"indentWidth": "2",
"nextControlFlowPosition": "sameLine",
"bracePosition": "sameLine"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bug related to this config option that is now fixed: https://github.com/dsherret/dprint/issues/180

"indentWidth": "2",
"nextControlFlowPosition": "sameLine",
"bracePosition": "sameLine"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace this with...

{
    "deno": true
}

...to have the same config (I renamed this from "prettier" to "deno" because it was different on trailing commas).

Then you may want to test out and provide feedback on the new preferSingleLine option:

{
    "deno": true,
    "preferSingleLine": true
}

...I'm still working on improving that, but I'll turn it on soon in the deno config because it's what prettier does.

Main things for me still are:

  1. More preferSingleLine config.
  2. Improve binary expression formatting (ex. 1 + 2)

@bartlomieju
Copy link
Member

Still waiting on dprint/dprint#81. This PR got stale; closing without merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants