eslint: more rules, no-duplicate-imports

This commit is contained in:
Rory&
2026-04-19 21:54:08 +02:00
parent 5f8afbc7ae
commit a4913dc25f
11 changed files with 15 additions and 17 deletions
Binary file not shown.
Binary file not shown.
+6
View File
@@ -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 });
+1 -2
View File
@@ -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 });
+1 -2
View File
@@ -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";
+1 -2
View File
@@ -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
+1 -1
View File
@@ -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";
+2 -4
View File
@@ -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();
+1 -2
View File
@@ -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 -2
View File
@@ -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;