Add ESLint (#941)
* Add eslint, switch to lint-staged for precommit * Fix all ESLint errors * Update GH workflow to check prettier and eslint
This commit is contained in:
@@ -64,6 +64,7 @@ export enum CLOSECODES {
|
||||
|
||||
export interface Payload {
|
||||
op: OPCODES /* | VoiceOPCodes */;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
d?: any;
|
||||
s?: number;
|
||||
t?: string;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
var erlpack: any;
|
||||
let erlpack: { pack: (data: Payload) => Buffer };
|
||||
try {
|
||||
erlpack = require("@yukikaze-bot/erlpack");
|
||||
} catch (error) {
|
||||
@@ -63,7 +63,7 @@ export function Send(socket: WebSocket, data: Payload) {
|
||||
return;
|
||||
}
|
||||
|
||||
socket.send(buffer, (err: any) => {
|
||||
socket.send(buffer, (err) => {
|
||||
if (err) return rej(err);
|
||||
return res(null);
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Intents, Permissions } from "@fosscord/util";
|
||||
import { Intents, ListenEventOpts, Permissions } from "@fosscord/util";
|
||||
import WS from "ws";
|
||||
import { Deflate, Inflate } from "fast-zlib";
|
||||
// import { Client } from "@fosscord/webrtc";
|
||||
@@ -37,8 +37,8 @@ export interface WebSocket extends WS {
|
||||
intents: Intents;
|
||||
sequence: number;
|
||||
permissions: Record<string, Permissions>;
|
||||
events: Record<string, Function>;
|
||||
member_events: Record<string, Function>;
|
||||
listen_options: any;
|
||||
events: Record<string, undefined | (() => unknown)>;
|
||||
member_events: Record<string, () => unknown>;
|
||||
listen_options: ListenEventOpts;
|
||||
// client?: Client;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user