Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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?
that which

I find 'abominations' maybe reads a bit too opinionated, but that's also just my opinion! 😄


### 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

Choose a reason for hiding this comment

The 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.

Choose a reason for hiding this comment

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

*discouraged
but isn't it more about readability than screen size?


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...

Choose a reason for hiding this comment

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

a little

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.
Copy link
Member Author

Choose a reason for hiding this comment

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

The v2 link is broken!

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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",
};
```
1 change: 0 additions & 1 deletion prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"singleQuote": true,
"useTabs": true,
"printWidth": 100,
"trailingComma": "es5",
"arrowParens": "avoid"
}