From 84566bea486b727da4395822fb8082fbd87445fc Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Tue, 26 Mar 2024 15:13:33 +0100 Subject: [PATCH] build: Do not use the linting-tsconfig for emitting files Only use "tsconfig.build.json" for building and emitting. Use "tsconfig.json" for checking for compiler errors and for integrating with typescript-eslint. The directory structure emitted when using "tsconfig.json" is different from the regular build in the sense that it contains an additional "src" directory level. Configuring "noEmit: true" in the tsconfig file causes issues for the typescript-eslint integration. Therefore the flag is only set in the npm script. --- package.json | 2 +- tsconfig.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f6f62a3d6..1e982fd6e 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "type": "module", "scripts": { "build": "npm run cleanup && tsc -p tsconfig.build.json", - "build-test": "npm run cleanup && tsc -p .", + "build-test": "tsc --noEmit -p .", "build-watch": "npm run cleanup && tsc -w -p tsconfig.build.json", "check-licenses": "licensee --errors-only", "cleanup": "rimraf lib coverage", diff --git a/tsconfig.json b/tsconfig.json index d4660870c..f7cec8a55 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,8 @@ // This is our configuration for development and linting, // compared to "tsconfig.build.json" it also includes tests // and other TypeScript sources in the project + // For this reason however, it should not be used to emit JavaScript (except for linting purposes), + // since the output directory would then contain "src" and "test" directories instead of just the content of "src" "extends": "./tsconfig.base.json", "include": [ "src/**/*",