andywer / webpack-blocks

📦 Configure webpack using functional feature blocks.
MIT License
2.97k stars 94 forks source link

Prettier #275

Closed vlad-zhukov closed 6 years ago

vlad-zhukov commented 6 years ago

Removed standard in favour of prettier.

Supersedes #263. Unlike that PR I've decided to drop standard completely because it doesn't make any noticeable difference. Also I decided to not setup on commit hook as it's never worked good for me, if someone finds it useful send another PR.

@andywer @zcei @dmitmel @jvanbruegge

andywer commented 6 years ago

Prettier is a good idea!

Just two questions that we should discuss together (didn't we have an ongoing discussion somewhere already?):

  1. Wouldn't it be best to still stick to a widespread code style, prettier or not?
  2. I think dropping eslint is a mistake, since prettier is just for code style, while eslint's capabilities go beyond that (and we already use them)? We need it to detect unused variables, broken references and similar.
zcei commented 6 years ago

+1 for not adding a pre-commit hook. That only made me use --no-verify more often than not :D

I also agree with Andy in that we still should have an ESLint setup for more code semantics. Could either stick with standard or try to align Prettier with ESLint by incorporating an ESLint setup, maybe with standard preset to keep changes to a minimum.

jvanbruegge commented 6 years ago

Why no pre-commit hook? Prettier runs fast and this keeps the code formatted, ie it wont stop your commit. I understand that with linters as you do WIP commits, but prettier is not really an issue.

vlad-zhukov commented 6 years ago

Right, nice that you've reminded me of eslint, I forgot about that one 😄. Can I set it up in the next PR?

@andywer

  1. I've configured prettier to be as close to standard as possible for now (but changes are inevitable). The great thing about the prettier is that it enforces the way how to read the code, but not how write it. With it I can write code the hell I want (messy whitespace, long ass lines and so on) to a point when I can't even read it, then simply run yarn format, and my code is fine again.
andywer commented 6 years ago

Yeah, might make most sense to do it in this PR. Could do it in a follow-up PR, but then we should also create an issue for that, so we definitely don't forget about it...

vlad-zhukov commented 6 years ago

The ESLint issue is on my list (#264)! And I will definitely not forget about anymore because I am going to start working on it right away!

vlad-zhukov commented 6 years ago

Added eslint! 🎉