Skip to content

Commit 0e37331

Browse files
authored
Merge pull request #55 from hwangsihu/main
Update packages and typescript
2 parents 9dfa97a + 654cd31 commit 0e37331

File tree

11 files changed

+83
-56
lines changed

11 files changed

+83
-56
lines changed

.eslintignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ testBot/package-lock.json
66
testBot/yarn.lock
77
testBot/bun.lockdb
88
testBot/src
9+
testBot/package-lock.json
910
.vscode
1011
bun.lockb
1112
yarn.lock

config/tsconfig.cjs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../tsconfig",
33
"compilerOptions": {
4-
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
4+
"module": "CommonJS" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
55
"outDir": "../dist/cjs" /* Redirect output structure to the directory. */
66
}
77
}

eslint.config.mjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2+
import tsParser from "@typescript-eslint/parser";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
import js from "@eslint/js";
6+
import { FlatCompat } from "@eslint/eslintrc";
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all
14+
});
15+
16+
export default [{
17+
ignores: [
18+
"**/config",
19+
"**/dist",
20+
"**/docs",
21+
"**/node_modules",
22+
"**/testBot",
23+
"**/tsDocs",
24+
"**/tools",
25+
"**/.*.js",
26+
"**/.*.mjs",
27+
"**/.*.ts",
28+
],
29+
}, ...compat.extends("plugin:@typescript-eslint/recommended"), {
30+
plugins: {
31+
"@typescript-eslint": typescriptEslint,
32+
},
33+
34+
languageOptions: {
35+
globals: {},
36+
parser: tsParser,
37+
ecmaVersion: "latest",
38+
sourceType: "module",
39+
40+
parserOptions: {
41+
project: "tsconfig.json",
42+
},
43+
},
44+
45+
rules: {
46+
"@typescript-eslint/consistent-type-imports": "error",
47+
"@typescript-eslint/no-explicit-any": 1,
48+
"@typescript-eslint/no-unsafe-declaration-merging": 1,
49+
"@typescript-eslint/no-unused-vars": 1,
50+
},
51+
}];

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,21 @@
5353
},
5454
"homepage": "https://lc4.gitbook.io/lavalink-client/",
5555
"devDependencies": {
56-
"@types/node": "^20.4.8",
57-
"@types/ws": "^8.5.5",
58-
"@typescript-eslint/eslint-plugin": "^6.4.0",
59-
"@typescript-eslint/parser": "^6.4.0",
60-
"eslint": "^8.47.0",
56+
"@eslint/eslintrc": "^3.1.0",
57+
"@eslint/js": "^9.11.0",
58+
"@types/node": "^22.5.5",
59+
"@types/ws": "^8.5.12",
60+
"@typescript-eslint/eslint-plugin": "^8.6.0",
61+
"@typescript-eslint/parser": "^8.6.0",
62+
"eslint": "^9.11.0",
6163
"tsc-alias": "^1.8.10",
62-
"typedoc": "^0.25.4",
63-
"typedoc-theme-hierarchy": "^4.1.2",
64-
"typescript": "^5.1.6"
64+
"typedoc": "^0.26.7",
65+
"typedoc-theme-hierarchy": "^5.0.3",
66+
"typescript": "^5.6.2"
6567
},
6668
"dependencies": {
67-
"tslib": "^2.6.1",
68-
"ws": "^8.13.0"
69+
"tslib": "^2.7.0",
70+
"ws": "^8.18.0"
6971
},
7072
"engines": {
7173
"node": ">=18.0.0",

src/structures/Node.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ export class LavalinkNode {
333333

334334
const res = await this.request(`/sessions/${this.sessionId}/players/${data.guildId}`, r => {
335335
r.method = "PATCH";
336-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
336+
337337
r.headers!["Content-Type"] = "application/json";
338338

339339
r.body = JSON.stringify(data.playerOptions);
@@ -631,7 +631,7 @@ export class LavalinkNode {
631631
return await this.request(`/decodetracks`, r => {
632632
r.method = "POST";
633633
r.body = JSON.stringify(encodeds);
634-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
634+
635635
r.headers!["Content-Type"] = "application/json";
636636
}).then((r:LavalinkTrack[]) => r.map(track => this.NodeManager.LavalinkManager.utils.buildTrack(track, requester)));
637637
}
@@ -831,7 +831,7 @@ export class LavalinkNode {
831831
if (!this.sessionId) throw new Error("the Lavalink-Node is either not ready, or not up to date!");
832832
await this.request(`/routeplanner/free/address`, r => {
833833
r.method = "POST";
834-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
834+
835835
r.headers!["Content-Type"] = "application/json";
836836
r.body = JSON.stringify({ address });
837837
});
@@ -850,7 +850,7 @@ export class LavalinkNode {
850850
if (!this.sessionId) throw new Error("the Lavalink-Node is either not ready, or not up to date!");
851851
return await this.request(`/routeplanner/free/all`, r => {
852852
r.method = "POST";
853-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
853+
854854
r.headers!["Content-Type"] = "application/json";
855855
});
856856
}

src/structures/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ export class MiniMap<K, V> extends Map<K, V> {
468468
const iter = this.entries();
469469
return Array.from({ length: this.size }, (): T => {
470470
const [key, value] = iter.next().value;
471-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
471+
472472
return fn(value, key, this);
473473
});
474474
}

testBot/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
"author": "Tomato6966",
1111
"license": "MIT",
1212
"dependencies": {
13-
"@redis/client": "^1.5.8",
14-
"@types/node": "^20.4.8",
15-
"@types/ws": "^8.5.5",
16-
"discord.js": "^14.12.1",
17-
"dotenv": "^16.3.1",
13+
"@redis/client": "^1.6.0",
14+
"@types/node": "^22.5.5",
15+
"@types/ws": "^8.5.12",
16+
"discord.js": "^14.16.2",
17+
"dotenv": "^16.4.5",
1818
"lavalink-client": "github:tomato6966/lavalink-client",
19-
"redis": "^4.6.7",
20-
"ts-node": "^10.9.1",
21-
"ws": "^8.13.0"
19+
"redis": "^4.7.0",
20+
"ts-node": "^10.9.2",
21+
"ws": "^8.18.0"
2222
},
2323
"devDependencies": {
2424
"tsconfig-paths": "^4.2.0",
25-
"tslib": "^2.6.1",
26-
"typescript": "^5.1.6"
25+
"tslib": "^2.7.0",
26+
"typescript": "^5.6.2"
2727
}
2828
}

testBot/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"compilerOptions": {
33
"lib": [
4-
"ES2022", "DOM"
4+
"ESNext", "DOM"
55
],
6-
"target": "ES2018",
6+
"target": "ESNext",
77
"module": "commonjs",
88
"moduleResolution": "node",
99
"outDir": "dist",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
/* Basic Options */
4-
"target": "ES2022",
4+
"target": "ESNext",
55
"module": "CommonJS",
66
"declaration": true,
77
"outDir": "./dist",

0 commit comments

Comments
 (0)