From 4b71954dbba51243d7a74705deffdf540737a453 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 30 Apr 2024 09:22:16 +0200 Subject: [PATCH] fix(api): only import types from ts-reset (#54565) --- api/src/reset.d.ts | 1 + api/src/server.ts | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 api/src/reset.d.ts diff --git a/api/src/reset.d.ts b/api/src/reset.d.ts new file mode 100644 index 00000000000..12bd3edc94a --- /dev/null +++ b/api/src/reset.d.ts @@ -0,0 +1 @@ +import '@total-typescript/ts-reset'; diff --git a/api/src/server.ts b/api/src/server.ts index 5eface1b19b..1383cebea98 100644 --- a/api/src/server.ts +++ b/api/src/server.ts @@ -1,6 +1,8 @@ -// We import these declaration files here, in the entry point of our application, so -// that they're available throughout. -import '@total-typescript/ts-reset'; +// We need to use the triple-slash directive to ensure that ts-node uses the +// reset.d.ts file. It's not possible to import the file directly because it +// is not included in the build (it's a dev dependency). +// eslint-disable-next-line @typescript-eslint/triple-slash-reference +/// import { build } from './app'; import { FREECODECAMP_NODE_ENV, PORT } from './utils/env';