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

Pretty print using prettier #25

Merged
merged 4 commits into from
Jan 21, 2018
Merged

Pretty print using prettier #25

merged 4 commits into from
Jan 21, 2018

Conversation

mohsen1
Copy link
Contributor

@mohsen1 mohsen1 commented Jan 20, 2018

Fixes #18

TODO:

  • Update tests with pretty printed output
  • Detect single quote vs double quote from source file and use it for prettier
  • Detect indentation from source file and use it for prettier
  • Detect code width from source file and use it for prettier
  • Detect semi from source file and use to for prettier option (not sure if possible)
  • CLI accept all prettier options and proxy it to prettier

@@ -1,4 +1,4 @@
type Foo = {
foo: string;
bar: number;
foo: string,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why no indent?!

@@ -1,9 +1,8 @@
class Foo {
render() {
return '100';
return '100'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

semi should be on by default. this is a bug

@@ -1,9 +1,9 @@
type HelloProps = {
message?: string;
message?: string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tabs?!

@vincentbel
Copy link
Contributor

@mohsen1 I think we can resolve prettier config by default by using prettier.resolveConfig. And also support setting prettier config in CLI.

@mohsen1
Copy link
Contributor Author

mohsen1 commented Jan 21, 2018

Beautiful! I didn't notice that api

@mohsen1 mohsen1 merged commit 95f308b into master Jan 21, 2018
@mohsen1 mohsen1 deleted the pass-prettier branch January 21, 2018 19:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants