From 593efb3602d5abcf201bf59b039f333b1f3f13ff Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Fri, 29 Jan 2021 19:07:39 +0200 Subject: [PATCH] raise the ES target level and enable sourcemaps in tsconfig.json --- src/core/command.ts | 18 +++++++++++------- tsconfig.json | 5 +++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/core/command.ts b/src/core/command.ts index 7ba0f02..b5fa826 100644 --- a/src/core/command.ts +++ b/src/core/command.ts @@ -182,12 +182,16 @@ export async function loadCommands(): Promise> { if (cmd.isDirectory()) { if (cmd.name === "subcommands") continue; else $.warn(`You can't have multiple levels of directories! From: "dist/commands/${cmd.name}"`); - } else loadCommand(cmd.name, list, selected.name); + } else if (cmd.name.endsWith(".js")) { + loadCommand(cmd.name, list, selected.name); + } } subdir.close(); categories.set(category, list); - } else loadCommand(selected.name, listMisc); + } else if (selected.name.endsWith(".js")) { + loadCommand(selected.name, listMisc); + } } dir.close(); @@ -236,7 +240,7 @@ export default new Command({ permission: null, aliases: [], async run($: CommonLibrary): Promise { - + }, subcommands: { layer: new Command({ @@ -246,7 +250,7 @@ export default new Command({ permission: null, aliases: [], async run($: CommonLibrary): Promise { - + } }) }, @@ -256,7 +260,7 @@ export default new Command({ usage: '', permission: null, async run($: CommonLibrary): Promise { - + } }), number: new Command({ @@ -265,7 +269,7 @@ export default new Command({ usage: '', permission: null, async run($: CommonLibrary): Promise { - + } }), any: new Command({ @@ -274,7 +278,7 @@ export default new Command({ usage: '', permission: null, async run($: CommonLibrary): Promise { - + } }) });`; diff --git a/tsconfig.json b/tsconfig.json index ba4dd11..34245ef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "rootDir": "src", "outDir": "dist", - "target": "ES6", + "target": "es2019", "module": "CommonJS", "moduleResolution": "node", "esModuleInterop": true, @@ -11,7 +11,8 @@ "strictNullChecks": true, "strictFunctionTypes": true, "strictPropertyInitialization": true, - "removeComments": true + "removeComments": true, + "sourceMap": true }, "exclude": ["test"] }