-
Notifications
You must be signed in to change notification settings - Fork 0
docs: add opinions to readme #1
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,38 @@ | |
|
|
||
| Shared Prettier configuration for usage within the [fullstax Gmbh & CO. KG](https://www.fullstax.de). | ||
|
|
||
| ## Opinions | ||
|
|
||
| We stick to the very opinionated [default options](https://prettier.io/docs/en/options.html) of the [current version of prettier](https://www.npmjs.com/package/prettier) but we have a few (strong) opinions of our own: | ||
|
|
||
| ### singleQuote | ||
|
|
||
| We set `singleQuote: true`. | ||
|
|
||
| We don't use jsx or other abominations, and also don't thing you should put long strings inside you code. So for us singel quotes are just more lightweight and improve readability when used together with string-templates, that we use for most strings. | ||
|
|
||
| ### useTabs | ||
|
|
||
| We set `useTabs: true` and we have a very strong opinion about this! | ||
|
|
||
| Why the hell would you use spaces for indentation? That's just very unprofessional! https://www.youtube.com/watch?v=SsoOG6ZeyUI | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also find the phrasing here on the too opinionated side - for example, if someone hasn't ever come across the tabs/spaces debate (and let's be honest, it's not exactly the first thing you need to learn), then calling them unprofessional reads a bit mean, and probably does more to put them off, rather than 'convert' them. Maybe there's a way to have the strong opinion in a less confrontational way? |
||
|
|
||
| ### printWidth | ||
|
|
||
| We use a `printWidth` of `100` instead of the default `80` | ||
|
|
||
| While this is explicitly discurraged in [the prettier docs](https://prettier.io/docs/en/options.html#print-width) we acknowledge that screens are much wider than high, nowadays. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. *discouraged |
||
|
|
||
| We just prefer a little less broken up lines in our code. This is not a strong opinion but instead of putting a big warning-block inside their docs prettier should acknowledge that a lot of projects currently overwrite the default of 80! Not every developer is using vim... | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think the comment in the prettier docs is actually quite useful |
||
|
|
||
| ### arrowParens | ||
|
|
||
| We (still) use `arrowParens: avoid` | ||
|
|
||
| Prettier recently made the very hard change from `avoid` to `always` in v2](https://prettier.io/docs/en/options.html#arrow-function-parentheses). While we think the change makes sense we want to keep out code bases consistend for now. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The v2 link is broken! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems okay to me? |
||
|
|
||
| We propably will change this in a future version! | ||
|
|
||
| ## Install | ||
|
|
||
| ```bash | ||
|
|
@@ -29,6 +61,6 @@ This option is useful, if you want to overwrite the common config with a project | |
| ```js | ||
| module.exports = { | ||
| ...require("@fullstax/prettier-config"), | ||
| "printWidth": 80, | ||
| "arrowParens": "always", | ||
| }; | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,5 @@ | |
| "singleQuote": true, | ||
| "useTabs": true, | ||
| "printWidth": 100, | ||
| "trailingComma": "es5", | ||
| "arrowParens": "avoid" | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*think
*your code
us,
*single
string-templates -> is the 'proper' term template literals?
thatwhichI find 'abominations' maybe reads a bit too opinionated, but that's also just my opinion! 😄