webxdc / store

XDC store, migrated to codeberg
https://codeberg.org/webxdc/store
5 stars 0 forks source link

use a code formatter #195

Closed Simon-Laux closed 1 year ago

Simon-Laux commented 1 year ago

I recommend/like prettier. But anything predictable will do.

Septias commented 1 year ago

We use eslint already.

Simon-Laux commented 1 year ago

linting !== formatting

For me there is too much openness in the eslint fixing, like it allows more variants of code formatting, where prettier is a lot stricter. for example prettier enforces a max line length where this is not the case with eslint fix.

Simon-Laux commented 1 year ago

try this out: format a document with prettier, then run eslint fix, Observe that it does not return to the previous state of the code.

Septias commented 1 year ago

Eslint can also do formatting but is more configurable. The main point from antfu is, that line formatting sometimes makes the GitHub diff not display as much useful information as it could. I agree with that and it's not like there is no formatting, we actually use antfus eslint config which has basic formatting.

Also see: https://antfu.me/posts/why-not-prettier