aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev/eval.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-31 21:29:06 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-01-31 21:29:06 -0500
commitfd5dbb05d741fec683c210aed012a55c7da0ca87 (patch)
tree7ba4b0e86830114843dd225b5d45a44675877b72 /src/commands/dev/eval.ts
parent9a051637d1e529f634c1becf0934b9559a6f1b90 (diff)
downloadtanzanite-fd5dbb05d741fec683c210aed012a55c7da0ca87.tar.gz
tanzanite-fd5dbb05d741fec683c210aed012a55c7da0ca87.tar.bz2
tanzanite-fd5dbb05d741fec683c210aed012a55c7da0ca87.zip
misc
Diffstat (limited to 'src/commands/dev/eval.ts')
-rw-r--r--src/commands/dev/eval.ts22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index 617672f..3c9b54c 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -37,13 +37,16 @@ import {
SelectMenuComponent,
Util
} from 'discord.js';
+import path from 'path';
import ts from 'typescript';
+import { fileURLToPath } from 'url';
import { promisify } from 'util';
const { transpile } = ts,
emojis = util.emojis,
colors = util.colors,
sh = promisify(exec),
- SnowflakeUtil = new Snowflake_(1420070400000n);
+ SnowflakeUtil = new Snowflake_(1420070400000n),
+ __dirname = path.dirname(fileURLToPath(import.meta.url));
/* eslint-enable @typescript-eslint/no-unused-vars */
export default class EvalCommand extends BushCommand {
@@ -191,7 +194,22 @@ export default class EvalCommand extends BushCommand {
const code: { ts: string | null; js: string; lang: 'ts' | 'js' } = {
ts: isTypescript ? rawCode : null,
- js: isTypescript ? transpile(rawCode) : rawCode,
+ js: isTypescript
+ ? transpile(rawCode, {
+ module: ts.ModuleKind.ESNext,
+ target: ts.ScriptTarget.ESNext,
+ moduleResolution: ts.ModuleResolutionKind.NodeNext,
+ lib: ['esnext'],
+ sourceMap: true,
+ incremental: true,
+ experimentalDecorators: true,
+ emitDecoratorMetadata: true,
+ resolveJsonModule: true,
+ noImplicitOverride: true,
+ noErrorTruncation: true,
+ strict: true
+ })
+ : rawCode,
lang: isTypescript ? 'ts' : 'js'
};