mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-11 01:47:09 +00:00
eslint: more rules, no-duplicate-imports
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -48,6 +48,12 @@ export default defineConfig([
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"@typescript-eslint/no-deprecated": "warn",
|
||||
"array-callback-return": "error",
|
||||
"no-constructor-return": "error",
|
||||
"no-duplicate-imports": "error",
|
||||
// unsure what the defaults are here, but we want them to error
|
||||
"for-direction": "error",
|
||||
"constructor-super": "error",
|
||||
"getter-return": "error",
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{ name: "@spacebar/api*", message: "Did you mean @spacebar/api?" },
|
||||
|
||||
@@ -17,9 +17,8 @@
|
||||
*/
|
||||
|
||||
import { randomString, route } from "@spacebar/api";
|
||||
import { Channel, Config, Permissions } from "@spacebar/util";
|
||||
import { CloudAttachment, Channel, Config, Permissions } from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { CloudAttachment } from "@spacebar/util";
|
||||
import { UploadAttachmentRequestSchema, UploadAttachmentResponseSchema } from "@spacebar/schemas";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
@@ -17,10 +17,9 @@
|
||||
*/
|
||||
|
||||
import { route } from "@spacebar/api";
|
||||
import { Ban, DiscordApiErrors, GuildBanAddEvent, Member, User, emitEvent } from "@spacebar/util";
|
||||
import { Ban, Config, DiscordApiErrors, GuildBanAddEvent, Member, User, emitEvent } from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { Config } from "@spacebar/util";
|
||||
|
||||
const router: Router = Router({ mergeParams: true });
|
||||
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Config, hasValidSignature, NewUrlUserSignatureData, Snowflake, UrlSignResult } from "@spacebar/util";
|
||||
import { Config, CloudAttachment, hasValidSignature, NewUrlUserSignatureData, Snowflake, UrlSignResult } from "@spacebar/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import imageSize from "image-size";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { multer } from "../util/multer";
|
||||
import { storage } from "@spacebar/cdn";
|
||||
import { CloudAttachment } from "@spacebar/util";
|
||||
import { fileTypeFromBuffer } from "file-type";
|
||||
import { cache } from "../util/cache";
|
||||
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Payload, WebSocket } from "@spacebar/gateway";
|
||||
import { Payload, WebSocket, genVoiceToken } from "@spacebar/gateway";
|
||||
import { Config, emitEvent, Guild, Member, VoiceServerUpdateEvent, VoiceState, VoiceStateUpdateEvent } from "@spacebar/util";
|
||||
import { genVoiceToken } from "@spacebar/gateway";
|
||||
import { check } from "./instanceOf";
|
||||
import { Region, VoiceStateUpdateSchema } from "@spacebar/schemas";
|
||||
// TODO: check if a voice server is setup
|
||||
|
||||
@@ -41,8 +41,8 @@ import {
|
||||
PublicMessage,
|
||||
Reaction,
|
||||
UnfurledMediaItem,
|
||||
PartialUser,
|
||||
} from "@spacebar/schemas";
|
||||
import { PartialUser } from "@spacebar/schemas";
|
||||
import { MessageFlags } from "@spacebar/util";
|
||||
import { JsonRemoveEmpty } from "../util/Decorators";
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ import EventEmitter from "node:events";
|
||||
import { EVENT, Event } from "../interfaces";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import path from "node:path";
|
||||
import { Socket } from "node:net";
|
||||
import { FSWatcher } from "node:fs";
|
||||
import net, { Socket } from "node:net";
|
||||
import fs, { FSWatcher } from "node:fs";
|
||||
import { Stopwatch } from "./Stopwatch";
|
||||
import { Config } from "./Config";
|
||||
import net from "node:net";
|
||||
import fs from "node:fs";
|
||||
import { red } from "picocolors";
|
||||
|
||||
export const events = new EventEmitter();
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { BitField } from "./BitField";
|
||||
import { BitFieldResolvable, BitFlag } from "./BitField";
|
||||
import { BitField, BitFieldResolvable, BitFlag } from "./BitField";
|
||||
import { User } from "../entities";
|
||||
import { HTTPError } from "lambert-server";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import express, { Application, Router } from "express";
|
||||
import { Server as HTTPServer } from "node:http";
|
||||
import http from "node:http";
|
||||
import http, { Server as HTTPServer } from "node:http";
|
||||
|
||||
export type ServerOptions = {
|
||||
port: number;
|
||||
|
||||
Reference in New Issue
Block a user