From f790e7abe913ea8c7a6f1129ee4326ee60bbe804 Mon Sep 17 00:00:00 2001 From: tianyingchun Date: Fri, 14 Feb 2025 21:20:35 +0800 Subject: [PATCH] fix: remove `strictBuiltinIteratorReturn` to support old typescript --- .changeset/silver-hounds-hang.md | 5 +++++ src/tsconfig/getCompilerOptions.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/silver-hounds-hang.md diff --git a/.changeset/silver-hounds-hang.md b/.changeset/silver-hounds-hang.md new file mode 100644 index 0000000..680e13e --- /dev/null +++ b/.changeset/silver-hounds-hang.md @@ -0,0 +1,5 @@ +--- +"@hyperse/ts-node-paths": patch +--- + +remove `strictBuiltinIteratorReturn` to support old typescript diff --git a/src/tsconfig/getCompilerOptions.ts b/src/tsconfig/getCompilerOptions.ts index ff63f62..07b7e20 100644 --- a/src/tsconfig/getCompilerOptions.ts +++ b/src/tsconfig/getCompilerOptions.ts @@ -23,6 +23,10 @@ export function getCompilerOptions(path: string): CompilerOptions { showWarns("`baseUrl` use './' instead of `./src`", path); } + // compatibility to support old typescript before 5.6. + // strictBuiltinIteratorReturn - strictBuiltinIteratorReturn Built-in iterators are instantiated with a `TReturn` type of undefined instead of `any`. + delete compilerOptions.strictBuiltinIteratorReturn; + return { paths: {}, // https://forgemia.inra.fr/lipme/ts-biofiledetector/-/blob/main/tsconfig.json