mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-25 12:04:39 +00:00
eslint: default-case
This commit is contained in:
@@ -56,6 +56,15 @@ export default defineConfig([
|
||||
"no-unmodified-loop-condition": "error",
|
||||
"no-unreachable-loop": "error",
|
||||
"arrow-body-style": ["error", "as-needed"],
|
||||
"block-scoped-var": "error",
|
||||
// some day...
|
||||
// "camelcase": ["error", {
|
||||
// properties: "never", //schemas
|
||||
// ignoreImports: true
|
||||
// }],
|
||||
// "consistent-return": "error",
|
||||
"default-case": "error",
|
||||
"default-case-last": "error",
|
||||
// unsure what the defaults are here, but we want them to error
|
||||
"for-direction": "error",
|
||||
"constructor-super": "error",
|
||||
|
||||
@@ -231,6 +231,9 @@ async function consume(this: WebSocket, opts: EventOpts) {
|
||||
});
|
||||
this.close(CLOSECODES.Invalid_session); // TODO: this is deprecated?
|
||||
return;
|
||||
default:
|
||||
// no special treatment
|
||||
break;
|
||||
}
|
||||
|
||||
// subscription managment
|
||||
@@ -290,6 +293,9 @@ async function consume(this: WebSocket, opts: EventOpts) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// no special treatment
|
||||
break;
|
||||
}
|
||||
|
||||
// permission checking
|
||||
|
||||
@@ -50,6 +50,8 @@ export function instanceOf(type: any, value: any, { path = "", optional = false
|
||||
case Object:
|
||||
if (typeof value === "object" && value !== null) return true;
|
||||
throw `${path} must be a object`;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (typeof type === "object") {
|
||||
|
||||
Reference in New Issue
Block a user