From bf0227e815772ed0541b76411be44befdf49b6e8 Mon Sep 17 00:00:00 2001 From: Orta Date: Thu, 12 Nov 2020 08:35:44 -0500 Subject: [PATCH] Switches the bundlePackageName error message to be a suggestion, and not a compiler error --- src/compiler/diagnosticMessages.json | 4 ++-- src/compiler/program.ts | 4 ++-- .../reference/bundledDtsLateExportRenaming.errors.txt | 4 ++-- .../reference/bundledNodeDTSFailsWithOutFlag.errors.txt | 4 ++-- .../baselines/reference/typeReferenceDirectives12.errors.txt | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b24b240504455..c1fc54a653587 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1192,8 +1192,8 @@ "category": "Message", "code": 1390 }, - "The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit.": { - "category": "Error", + "The `bundledPackageName` option should be provided when using outFile and node module resolution with declaration emit.": { + "category": "Suggestion", "code": 1391 }, "The types of '{0}' are incompatible between these types.": { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 33c3b67e9ede9..8ccd1c5ed3683 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -3221,9 +3221,9 @@ namespace ts { } } - // Without a package name, for multiple files being bundled into a .d.ts file you basically get a file which doesn't wrk + // Without a package name, for multiple files being bundled into a .d.ts file you basically get a file which doesn't work if (outputFile && getEmitDeclarations(options) && getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeJs && !options.bundledPackageName) { - createDiagnosticForOptionName(Diagnostics.The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit, options.out ? "out" : "outFile"); + createDiagnosticForOptionName(Diagnostics.The_bundledPackageName_option_should_be_provided_when_using_outFile_and_node_module_resolution_with_declaration_emit, options.out ? "out" : "outFile"); } if (options.resolveJsonModule) { diff --git a/tests/baselines/reference/bundledDtsLateExportRenaming.errors.txt b/tests/baselines/reference/bundledDtsLateExportRenaming.errors.txt index 4f96a9965ae4b..2056d2c0a23da 100644 --- a/tests/baselines/reference/bundledDtsLateExportRenaming.errors.txt +++ b/tests/baselines/reference/bundledDtsLateExportRenaming.errors.txt @@ -1,7 +1,7 @@ -error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. +suggestion TS1391: The `bundledPackageName` option should be provided when using outFile and node module resolution with declaration emit. -!!! error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. +!!! suggestion TS1391: The `bundledPackageName` option should be provided when using outFile and node module resolution with declaration emit. ==== tests/cases/compiler/index.ts (0 errors) ==== export * from "./nested"; diff --git a/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.errors.txt b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.errors.txt index 33c7b6a659d42..acdd0f34489de 100644 --- a/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.errors.txt +++ b/tests/baselines/reference/bundledNodeDTSFailsWithOutFlag.errors.txt @@ -1,7 +1,7 @@ -error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. +suggestion TS1391: The `bundledPackageName` option should be provided when using outFile and node module resolution with declaration emit. -!!! error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. +!!! suggestion TS1391: The `bundledPackageName` option should be provided when using outFile and node module resolution with declaration emit. ==== tests/cases/conformance/declarationEmit/index.ts (0 errors) ==== export * from "./nested"; diff --git a/tests/baselines/reference/typeReferenceDirectives12.errors.txt b/tests/baselines/reference/typeReferenceDirectives12.errors.txt index 6fefacdf96f21..cdcef0b92987c 100644 --- a/tests/baselines/reference/typeReferenceDirectives12.errors.txt +++ b/tests/baselines/reference/typeReferenceDirectives12.errors.txt @@ -1,8 +1,8 @@ -error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. +suggestion TS1391: The `bundledPackageName` option should be provided when using outFile and node module resolution with declaration emit. /main.ts(1,14): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'. -!!! error TS1391: The `bundledPackageName` option must be provided when using outFile and node module resolution with declaration emit. +!!! suggestion TS1391: The `bundledPackageName` option should be provided when using outFile and node module resolution with declaration emit. ==== /mod2.ts (0 errors) ==== import { Cls } from "./main"; import "./mod1";