From 9e4bf22e84074409eb0dc9cb294c2523f976ad88 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Sun, 30 Jul 2023 13:42:23 +0200 Subject: [PATCH] fix: tsconfig Signed-off-by: Tilman Vatteroth --- .eslintrc.json | 2 +- jest.config.json | 2 +- src/index.test.ts | 2 +- tsconfig.base.json | 4 +--- tsconfig.cjs.json | 3 ++- tsconfig.esm.json | 1 + tsconfig.test.json | 4 ++++ 7 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 tsconfig.test.json diff --git a/.eslintrc.json b/.eslintrc.json index 870c4d2..8fa0fcd 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,7 +7,7 @@ "parser" : "@typescript-eslint/parser", "parserOptions" : { "project" : [ - "./tsconfig.esm.json" + "./tsconfig.test.json" ] }, "plugins" : [ diff --git a/jest.config.json b/jest.config.json index 49660eb..2f913da 100644 --- a/jest.config.json +++ b/jest.config.json @@ -15,7 +15,7 @@ "^.+\\.tsx?$" : [ "ts-jest", { - "tsconfig" : "tsconfig.esm.json", + "tsconfig" : "tsconfig.test.json", "useESM" : true } ] diff --git a/src/index.test.ts b/src/index.test.ts index 49f1e2e..26a01cf 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: MIT */ -import { Optional } from './index' +import { Optional } from './index.js' import { describe, expect, it } from '@jest/globals' describe('Optional', () => { diff --git a/tsconfig.base.json b/tsconfig.base.json index b608c5c..5978ade 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "noImplicitAny": true, "removeComments": true, "preserveConstEnums": true, "lib": [ @@ -11,11 +10,10 @@ "strict": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "moduleResolution": "node", "esModuleInterop": true, "allowJs": true, "sourceMap": true }, "include": ["src"], - "exclude": ["dist"] + "exclude": ["dist", "**/*.test.ts"] } diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index 3c50f0a..a88d7f7 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -4,6 +4,7 @@ "module": "CommonJS", "target": "ES2015", "outDir": "dist/cjs", - "declarationDir": "dist/cjs" + "declarationDir": "dist/cjs", + "moduleResolution": "node" } } diff --git a/tsconfig.esm.json b/tsconfig.esm.json index ebc873f..076d3bf 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -4,6 +4,7 @@ "module": "ESNext", "target" : "esnext", "outDir": "dist/esm", + "moduleResolution": "NodeNext", "declarationDir": "dist/esm" } } diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 0000000..80c3e38 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,4 @@ +{ + "extends" : "./tsconfig.esm.json", + "exclude": ["dist"] +}