switch-colon-spacing
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"switch-colon-spacing": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
switch (a) {
case 0 :break;
default :foo();
}switch (a) {
case 0: break;
default: foo();
}switch (a) {
case 0: foo(); break;
case 1:
bar();
break;
default:
baz();
break;
}switch (a) {
case 0 :foo(); break;
case 1 :
bar();
break;
default :
baz();
break;
}Examples from the ESLint documentation.
switch-colon-spacing
eslint
export default [
{
rules: {
"switch-colon-spacing": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow variable declarations from shadowing variables declared in the outer scope
Disallow nested ternary expressions
Enforce a maximum number of classes per file
Enforce default parameters to be last