unicorn/switch-case-braces Style
What it does
Require empty switch cases to not have braces. Non-empty braces are required to have braces around them.
Why is this bad?
There is less visual clutter for empty cases and proper scope for non-empty cases.
Example
javascript
switch (num) {
case 1: {
}
case 2:
console.log("Case 2");
break;
}
How to use
To enable this rule in the CLI or using the config file, you can use:
bash
oxlint --deny unicorn/switch-case-braces
json
{
"rules": {
"unicorn/switch-case-braces": "error"
}
}