From 4f513762acbbdf4c9b2b22fba962626c838b0762 Mon Sep 17 00:00:00 2001 From: Martin Hochel Date: Wed, 22 May 2024 20:11:22 +0200 Subject: [PATCH 1/2] chore(recipes-react-component): remve exclude config to properly include node_module types --- apps/recipes-react-components/tsconfig.app.json | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/recipes-react-components/tsconfig.app.json b/apps/recipes-react-components/tsconfig.app.json index 3d2934d25d2a72..124eb3b4f11f8b 100644 --- a/apps/recipes-react-components/tsconfig.app.json +++ b/apps/recipes-react-components/tsconfig.app.json @@ -6,6 +6,5 @@ "declaration": true, "inlineSources": true }, - "exclude": [], "include": ["./src/**/*.ts", "./src/**/*.tsx"] } From 5d37184e0b854029da8e71ceae45fc349d442f83 Mon Sep 17 00:00:00 2001 From: Martin Hochel Date: Wed, 22 May 2024 20:16:55 +0200 Subject: [PATCH 2/2] fix(tasks): make type-check task run with --noEmit and return only void Promise on success --- scripts/tasks/src/type-check.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/tasks/src/type-check.ts b/scripts/tasks/src/type-check.ts index 3c49c17225bd82..ed58d3c2d16c2b 100644 --- a/scripts/tasks/src/type-check.ts +++ b/scripts/tasks/src/type-check.ts @@ -4,7 +4,7 @@ import { exec } from 'just-scripts-utils'; import { type TsConfig, getTsPathAliasesConfig } from './utils'; -export async function typeCheck() { +export function typeCheck(): Promise | undefined { const { isUsingTsSolutionConfigs, tsConfigs } = getTsPathAliasesConfig(); if (!isUsingTsSolutionConfigs) { @@ -20,17 +20,22 @@ export async function typeCheck() { const tsConfigsRefs = getTsConfigs(config, { spec: false, e2e: false }); - const asyncQueue = []; + const asyncQueue: Array> = []; for (const ref of tsConfigsRefs) { - const program = `tsc -p ${ref} --pretty --baseUrl .`; + const program = `tsc -p ${ref} --pretty --baseUrl . --noEmit`; asyncQueue.push(exec(program)); } - return Promise.all(asyncQueue).catch(err => { - console.error(err.stdout); - process.exit(1); - }); + return Promise.all(asyncQueue) + .then(_ => { + logger.info('Type checking completed successfully'); + return; + }) + .catch(err => { + console.error(err.stdout); + process.exit(1); + }); } function getTsConfigs(solutionConfig: TsConfig, exclude: { spec: boolean; e2e: boolean }) {