1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 10:22:39 +01:00

turn off eslint rules causing issues

This commit is contained in:
dank074 2024-11-13 19:05:54 -06:00
parent f043dd455d
commit f499507698
12 changed files with 6 additions and 9 deletions

View File

@ -41,5 +41,7 @@ export default [{
"no-mixed-spaces-and-tabs": "off", "no-mixed-spaces-and-tabs": "off",
"@typescript-eslint/no-inferrable-types": "off", // Required by typeorm "@typescript-eslint/no-inferrable-types": "off", // Required by typeorm
"@typescript-eslint/no-var-requires": "off", // Sometimes requred by typeorm to resolve circular deps "@typescript-eslint/no-var-requires": "off", // Sometimes requred by typeorm to resolve circular deps
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-vars": "off",
}, },
}]; }];

View File

@ -108,7 +108,6 @@ export async function Authentication(
req.rights = new Rights(Number(user.rights)); req.rights = new Rights(Number(user.rights));
return next(); return next();
} catch (error) { } catch (error) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return next(new HTTPError(error!.toString(), 400)); return next(new HTTPError(error!.toString(), 400));
} }
} }

View File

@ -72,7 +72,6 @@ router.post(
await User.update({ id: user.id }, data); await User.update({ id: user.id }, data);
// come on, the user has to have an email to reset their password in the first place // come on, the user has to have an email to reset their password in the first place
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
await Email.sendPasswordChanged(user, user.email!); await Email.sendPasswordChanged(user, user.email!);
res.json({ token: await generateToken(user.id) }); res.json({ token: await generateToken(user.id) });

View File

@ -171,7 +171,6 @@ export async function onIdentify(this: WebSocket, data: Payload) {
// but we do want almost everything from guild. // but we do want almost everything from guild.
// How do you do that without just enumerating the guild props? // How do you do that without just enumerating the guild props?
guild: Object.fromEntries( guild: Object.fromEntries(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
getDatabase()! getDatabase()!
.getMetadata(Guild) .getMetadata(Guild)
.columns.map((x) => [x.propertyName, true]), .columns.map((x) => [x.propertyName, true]),

View File

@ -214,7 +214,6 @@ async function subscribeToMemberEvents(this: WebSocket, user_id: string) {
export async function onLazyRequest(this: WebSocket, { d }: Payload) { export async function onLazyRequest(this: WebSocket, { d }: Payload) {
// TODO: check data // TODO: check data
check.call(this, LazyRequestSchema, d); check.call(this, LazyRequestSchema, d);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { guild_id, typing, channels, activities, members } = const { guild_id, typing, channels, activities, members } =
d as LazyRequestSchema; d as LazyRequestSchema;

View File

@ -99,7 +99,6 @@ export async function onVoiceStateUpdate(this: WebSocket, data: Payload) {
voiceState.token = genVoiceToken(); voiceState.token = genVoiceToken();
voiceState.session_id = this.session_id; voiceState.session_id = this.session_id;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { id, ...newObj } = voiceState; const { id, ...newObj } = voiceState;
await Promise.all([ await Promise.all([

View File

@ -46,7 +46,7 @@ export class BaseClassWithoutId extends BaseEntity {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
toJSON(): any { toJSON(): any {
return Object.fromEntries( return Object.fromEntries(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/no-non-null-assertion // eslint-disable-next-line @typescript-eslint/ban-ts-comment
this.metadata!.columns // @ts-ignore this.metadata!.columns // @ts-ignore
.map((x) => [x.propertyName, this[x.propertyName]]) .map((x) => [x.propertyName, this[x.propertyName]])
.concat( .concat(

View File

@ -69,7 +69,6 @@ export interface MessageCreateSchema {
} }
// TypeScript complains once this is used above // TypeScript complains once this is used above
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface PollCreationSchema { interface PollCreationSchema {
question: PollMedia; question: PollMedia;
answers: PollAnswer[]; answers: PollAnswer[];

View File

@ -18,4 +18,5 @@
import { Team } from "@spacebar/util"; import { Team } from "@spacebar/util";
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface TeamListResponse extends Array<Team> {} export interface TeamListResponse extends Array<Team> {}

View File

@ -70,7 +70,6 @@ export function enableAutoUpdate(opts: {
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function download(url: string, dir: string) { async function download(url: string, dir: string) {
try { try {
// TODO: use file stream instead of buffer (to prevent crash because of high memory usage for big files) // TODO: use file stream instead of buffer (to prevent crash because of high memory usage for big files)

View File

@ -100,6 +100,7 @@ export async function listenEvent(
}; };
const listener = (msg: ProcessEvent) => { const listener = (msg: ProcessEvent) => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
msg.type === "event" && msg.type === "event" &&
msg.id === event && msg.id === event &&
callback({ ...msg.event, cancel }); callback({ ...msg.event, cancel });

View File

@ -117,7 +117,7 @@ export const Sentry = {
Integrations.setupExpressErrorHandler(app); Integrations.setupExpressErrorHandler(app);
// The typings for this are broken? // The typings for this are broken?
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-explicit-any
app.use(function onError(err: any, req: any, res: any, next: any) { app.use(function onError(err: any, req: any, res: any, next: any) {
res.statusCode = 500; res.statusCode = 500;
res.end(res.sentry + "\n"); res.end(res.sentry + "\n");