Open fregante opened 4 months ago
I use avoid
too, but Sindre prefer alway
https://github.com/sindresorhus/eslint-plugin-unicorn/pull/1709#issuecomment-1030263041
It's done for consistency. I feel it would look weird and inconsistent to only have braces when you need to use const
inside a case.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch#lexical_scoping
I've come to dislike
switch
because it's become so noisy and verbose over plain if/else, even if I have to repeat the condition multiple times.This:
Turns into:
The latter is arguably more readable/airy, but so is this:
I don’t think that the braces add anything here.