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

Get rid of prettier #20

Open
alien-mcl opened this issue Nov 4, 2017 · 4 comments
Open

Get rid of prettier #20

alien-mcl opened this issue Nov 4, 2017 · 4 comments

Comments

@alien-mcl
Copy link
Member

alien-mcl commented Nov 4, 2017

... or at least reconfigure it.
I try to embrace my own code reformatted by this component and I find it difficult.
My IDE's defaults shows a break line at 120 chars long line, but prettier mostly uses half of it.
I know that someone may need to print it with a legacy 80 chars long needle printer on a toilette paper or just switched from COBOL console, but these setting makes my Full HD 31 inch monitor pretty useless.
I don't know what readability preferences were used by creators, but when I try to write my code to be fluent-like where each line tries to be a sentence, it's a mess at the end.
It's my personal opinion, but please try to write/read some code reformatted with these settings before using it. For me, it's pain in the ... you know where.

@lanthaler
Copy link
Member

Prettier's default is 80 chars but it can be changed, see https://github.com/prettier/prettier#print-width. Is that the only issue you have with it? If not, what else bothers you? Some examples of formatting before and after might be useful.

@alien-mcl
Copy link
Member Author

Well, there are a few issues:

https://github.com/HydraCG/Heracles.ts/blob/master/src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts#L147
All arguments are neither in separate lines nor in a single one. I'd expected some consistency, either all arguments should span a separate line, or all should be side by side in single one (if still within the line length limit)

https://github.com/HydraCG/Heracles.ts/blob/master/src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts#L155
Why simple arrow functions should have braces around argument? The less non-alphanumeric chars the better.

I know that there are some of my personal preferences talking now, but generally I prefer to read code as english-like sentences and having every single word in a separate line is far from readable. Yes, I can see the tokens and names and all, but these are out of context built by the line(s) above.

@lanthaler
Copy link
Member

https://github.com/HydraCG/Heracles.ts/blob/master/src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts#L147
All arguments are neither in separate lines nor in a single one. I'd expected some consistency, either all arguments should span a separate line, or all should be side by side in single one (if still within the line length limit)

I agree. This seems to be a Prettier bug.

https://github.com/HydraCG/Heracles.ts/blob/master/src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts#L155
Why simple arrow functions should have braces around argument? The less non-alphanumeric chars the better.

Looks like you discovered the most discussed Prettier issue.

As said before, if this annoys you too much let's just disable it for now. I like having consistently formatted code but it shouldn't get in the way of getting work done. We can always reformat the code later if we want to.

@lanthaler lanthaler changed the title Get rid of prettier... Get rid of prettier Nov 6, 2017
@alien-mcl
Copy link
Member Author

I'll try to stick with it a little longer - yesterday I was really frustrated, but it was yesterday - I'll try to ignore it for a while and save/format once done.

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

No branches or pull requests

2 participants