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

Update configuration + custom logic #10

Open
samouri opened this issue Dec 28, 2017 · 4 comments
Open

Update configuration + custom logic #10

samouri opened this issue Dec 28, 2017 · 4 comments

Comments

@samouri
Copy link

samouri commented Dec 28, 2017

With the recent updates to Prettier, we can remove some custom hacks from the code:

  1. --require-pragma, --insert-pragma
  2. .prettierc

Also, while we are updating these things, should we change printWidth to 80?

cc @nylen

@samouri samouri changed the title Easier configuration Update configuration + custom logic Dec 28, 2017
@nylen
Copy link

nylen commented Jan 10, 2018

should we change printWidth to 80?

Personally I would say yes, and the prettier documentation agrees:

For readability we recommend against using more than 80 characters: [...]

However, I think some people prefer longer lines. As a compromise I would suggest 90 characters + increasing the tab width from 2 to 4.

@ntwb
Copy link

ntwb commented Jan 22, 2018

WordPress recommends 80 characters, I'm going to go with that for now and see how that looks for Gutenberg and WordPress core.

https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/#spacing

"Lines should usually be no longer than 80 characters, and should not exceed 100 (counting tabs as 4 spaces). This is a “soft” rule, but long lines generally indicate unreadable or disorganized code."

tabWidth should be removed, this is only used if using spaces for indentation.

@nylen
Copy link

nylen commented Jan 26, 2018

When using tabs for indentation, tabWidth is still needed to count line length correctly.

@ntwb
Copy link

ntwb commented Jan 26, 2018

Makes sense I guess in a Prettier context 👍

Though if one user uses 2 spaces and another user uses 4 spaces to display tab widths in their IDE/Editor then Prettier may appear to wrap code at column 78 for the 2nd user and column 80 for the first user if tabWidth = 80, lol, oh well, that's Prettier doing its thing I guess 😝

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

3 participants