Sourcery rule id:
Invert ternary operator to remove negation
const beverage = !too_young ? 'Beer' : 'Juice';
const beverage = too_young ? 'Juice': 'Beer';
Negated conditions are more difficult to read than positive ones, so it is best to avoid them where we can. By inverting the ternary condition and swapping the expressions we can simplify the code.