diff --git a/packages/modular-scripts/src/__tests__/typecheck.test.ts b/packages/modular-scripts/src/__tests__/typecheck.test.ts index 1a6ad622f..7dc113c9c 100644 --- a/packages/modular-scripts/src/__tests__/typecheck.test.ts +++ b/packages/modular-scripts/src/__tests__/typecheck.test.ts @@ -92,20 +92,6 @@ describe('Modular typecheck', () => { }); }); }); - describe('when run silently', () => { - it('should print a one line error message', async () => { - let output = ''; - try { - await execa('yarnpkg', ['modular', 'typecheck', '--silent'], { - all: true, - cleanup: true, - }); - } catch ({ stderr }) { - output = stderr as string; - } - expect(output).toMatch('\u0078 Typecheck did not pass'); - }); - }); }); describe('when there are no type errors', () => { it('should print a one line success message', async () => { diff --git a/packages/modular-scripts/src/cli.ts b/packages/modular-scripts/src/cli.ts index 19ecfeb3a..6538bfb54 100755 --- a/packages/modular-scripts/src/cli.ts +++ b/packages/modular-scripts/src/cli.ts @@ -226,20 +226,12 @@ program await port(relativePath); }); -interface TypecheckOptions { - silent: boolean; -} - program .command('typecheck') - .option( - '--silent', - 'silences the error messages gathered during the type check', - ) .description('Typechecks the entire project') - .action(async (options: TypecheckOptions) => { + .action(async () => { const { typecheck } = await import('./typecheck'); - await typecheck(options.silent); + await typecheck(); }); void startupCheck() diff --git a/packages/modular-scripts/src/typecheck.ts b/packages/modular-scripts/src/typecheck.ts index 3b4bdc730..584401eec 100644 --- a/packages/modular-scripts/src/typecheck.ts +++ b/packages/modular-scripts/src/typecheck.ts @@ -6,7 +6,7 @@ import getPackageMetadata from './utils/getPackageMetadata'; import * as logger from './utils/logger'; import getModularRoot from './utils/getModularRoot'; -export async function typecheck(silent = false): Promise { +export async function typecheck(): Promise { const { typescriptConfig } = await getPackageMetadata(); const { _compilerOptions, ...rest } = typescriptConfig; @@ -73,11 +73,6 @@ export async function typecheck(silent = false): Promise { .concat(emitResult.diagnostics); if (diagnostics.length) { - if (silent) { - // "x Typecheck did not pass" - throw new Error('\u0078 Typecheck did not pass'); - } - if (isCI) { // formatDiagnostics will return a readable list of error messages, each with its own line throw new Error(ts.formatDiagnostics(diagnostics, diagnosticHost));