Skip to content

Commit ce099e5

Browse files
author
Andy Hanson
committed
Change diagnostic message
1 parent 4937d9c commit ce099e5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ namespace ts {
14011401
if (compilerOptions.noImplicitAny) {
14021402
if (moduleNotFoundError) {
14031403
error(errorNode,
1404-
Diagnostics.A_package_for_0_was_found_at_1_but_is_untyped_Because_noImplicitAny_is_enabled_this_package_must_have_a_declaration,
1404+
Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,
14051405
moduleReference,
14061406
resolvedModule.resolvedFileName);
14071407
}

src/compiler/diagnosticMessages.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2869,10 +2869,6 @@
28692869
"category": "Error",
28702870
"code": 6143
28712871
},
2872-
"A package for '{0}' was found at '{1}', but is untyped. Because '--noImplicitAny' is enabled, this package must have a declaration.": {
2873-
"category": "Error",
2874-
"code": 6144
2875-
},
28762872
"Variable '{0}' implicitly has an '{1}' type.": {
28772873
"category": "Error",
28782874
"code": 7005
@@ -2905,6 +2901,10 @@
29052901
"category": "Error",
29062902
"code": 7015
29072903
},
2904+
"Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type.": {
2905+
"category": "Error",
2906+
"code": 7016
2907+
},
29082908
"Index signature of object type implicitly has an 'any' type.": {
29092909
"category": "Error",
29102910
"code": 7017

tests/baselines/reference/untypedModuleImport_noImplicitAny.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/a.ts(1,22): error TS6144: A package for 'foo' was found at '/node_modules/foo/index.js', but is untyped. Because '--noImplicitAny' is enabled, this package must have a declaration.
1+
/a.ts(1,22): error TS7016: Could not find a declaration file for module 'foo'. '/node_modules/foo/index.js' implicitly has an 'any' type.
22

33

44
==== /a.ts (1 errors) ====
55
import * as foo from "foo";
66
~~~~~
7-
!!! error TS6144: A package for 'foo' was found at '/node_modules/foo/index.js', but is untyped. Because '--noImplicitAny' is enabled, this package must have a declaration.
7+
!!! error TS7016: Could not find a declaration file for module 'foo'. '/node_modules/foo/index.js' implicitly has an 'any' type.
88

99
==== /node_modules/foo/index.js (0 errors) ====
1010
// This tests that `--noImplicitAny` disables untyped modules.

0 commit comments

Comments
 (0)