From 78229461e4fa0aad3088ff68f99dabb90f0c4fee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 00:37:13 +0000 Subject: [PATCH 1/3] Initial plan From b806976f5a71eb6cf3312f06cc04ff684930c06a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 01:02:47 +0000 Subject: [PATCH 2/3] Port TypeScript PR #63054: Set default `types` array to `[]`; support `"*"` wildcard Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> --- internal/checker/checker.go | 24 ++-- internal/compiler/fileInclude.go | 4 +- internal/core/compileroptions.go | 6 + internal/fourslash/_scripts/failingTests.txt | 102 +++++++++-------- internal/module/resolver.go | 25 +++- .../compiler/anonymousModules.errors.txt | 12 +- .../compiler/anonymousModules.errors.txt.diff | 39 +++++++ ...torWithIncompleteTypeAnnotation.errors.txt | 4 +- ...thIncompleteTypeAnnotation.errors.txt.diff | 18 ++- .../didYouMeanSuggestionErrors.errors.txt | 36 +++--- ...didYouMeanSuggestionErrors.errors.txt.diff | 76 +++++++++++++ ...ntDefineProperrtyPotentialMerge.errors.txt | 4 +- ...ineProperrtyPotentialMerge.errors.txt.diff | 4 +- .../compiler/externModule.errors.txt | 4 +- .../compiler/externModule.errors.txt.diff | 18 +++ .../compiler/innerModExport1.errors.txt | 4 +- .../compiler/innerModExport1.errors.txt.diff | 17 +++ .../compiler/innerModExport2.errors.txt | 4 +- .../compiler/innerModExport2.errors.txt.diff | 17 +++ .../compiler/metadataImportType.errors.txt | 4 +- .../metadataImportType.errors.txt.diff | 17 +++ .../compiler/moduleExports1.errors.txt | 8 +- .../compiler/moduleExports1.errors.txt.diff | 22 ++++ .../moduleKeywordRepeatError.errors.txt | 4 +- .../moduleKeywordRepeatError.errors.txt.diff | 16 +++ .../compiler/modulePreserve3.trace.json | 14 --- .../compiler/modulePreserve4.errors.txt | 8 +- .../compiler/modulePreserve4.errors.txt.diff | 22 +++- ...ion_automaticTypeDirectiveNames.errors.txt | 14 +++ ...utomaticTypeDirectiveNames.errors.txt.diff | 18 +++ ...lution_automaticTypeDirectiveNames.symbols | 6 +- ...n_automaticTypeDirectiveNames.symbols.diff | 13 +++ ...solution_automaticTypeDirectiveNames.types | 6 +- ...ion_automaticTypeDirectiveNames.types.diff | 12 ++ ...adingStaticFunctionsInFunctions.errors.txt | 12 +- ...StaticFunctionsInFunctions.errors.txt.diff | 43 +++++++ .../compiler/parseInvalidNames.errors.txt | 8 +- .../parseInvalidNames.errors.txt.diff | 38 +++++++ .../reactJsxReactResolvedNodeNext.trace.json | 9 -- ...eactJsxReactResolvedNodeNextEsm.trace.json | 9 -- ...ceTypesPreferedToPathIfPossible.errors.txt | 14 +++ ...esPreferedToPathIfPossible.errors.txt.diff | 18 +++ .../referenceTypesPreferedToPathIfPossible.js | 2 +- ...renceTypesPreferedToPathIfPossible.js.diff | 8 ++ ...renceTypesPreferedToPathIfPossible.symbols | 11 -- ...TypesPreferedToPathIfPossible.symbols.diff | 17 +++ ...ferenceTypesPreferedToPathIfPossible.types | 20 +--- ...ceTypesPreferedToPathIfPossible.types.diff | 30 +++++ .../compiler/reservedWords2.errors.txt | 8 +- .../compiler/reservedWords2.errors.txt.diff | 37 ++++++ .../compiler/staticsInAFunction.errors.txt | 12 +- .../staticsInAFunction.errors.txt.diff | 43 +++++++ ...uthinessCallExpressionCoercion4.errors.txt | 4 +- ...essCallExpressionCoercion4.errors.txt.diff | 4 +- .../typeReferenceDirectives1.trace.json | 7 -- .../typeReferenceDirectives10.trace.json | 7 -- .../compiler/typeReferenceDirectives13.js | 21 ++++ .../typeReferenceDirectives13.js.diff | 27 +++++ .../typeReferenceDirectives13.trace.json | 7 -- .../typeReferenceDirectives3.trace.json | 7 -- .../typeReferenceDirectives4.trace.json | 7 -- .../compiler/typeReferenceDirectives5.js | 21 ++++ .../compiler/typeReferenceDirectives5.js.diff | 27 +++++ .../typeReferenceDirectives5.trace.json | 7 -- .../compiler/typeReferenceDirectives6.js | 24 ++++ .../compiler/typeReferenceDirectives6.js.diff | 30 +++++ .../typeReferenceDirectives6.trace.json | 7 -- .../typeReferenceDirectives7.trace.json | 7 -- .../compiler/typeReferenceDirectives9.js | 45 ++++++++ .../compiler/typeReferenceDirectives9.js.diff | 51 ++++++++- .../typeReferenceDirectives9.trace.json | 7 -- ...mMultipleNodeModulesDirectories.errors.txt | 35 ++++++ ...ipleNodeModulesDirectories.errors.txt.diff | 39 +++++++ ...FromMultipleNodeModulesDirectories.symbols | 24 ---- ...ultipleNodeModulesDirectories.symbols.diff | 30 +++++ ...mMultipleNodeModulesDirectories.trace.json | 21 ---- ...tsFromMultipleNodeModulesDirectories.types | 40 ++----- ...mMultipleNodeModulesDirectories.types.diff | 52 +++++++++ ...romNodeModulesInParentDirectory.errors.txt | 17 +++ ...deModulesInParentDirectory.errors.txt.diff | 21 ++++ ...tsFromNodeModulesInParentDirectory.symbols | 8 -- ...mNodeModulesInParentDirectory.symbols.diff | 14 +++ ...romNodeModulesInParentDirectory.trace.json | 7 -- ...ootsFromNodeModulesInParentDirectory.types | 12 +- ...romNodeModulesInParentDirectory.types.diff | 20 ++++ .../compiler/typecheckIfCondition.errors.txt | 8 +- .../typecheckIfCondition.errors.txt.diff | 22 ++++ ...hReservedIdentifierInDottedPath.errors.txt | 4 +- ...rvedIdentifierInDottedPath.errors.txt.diff | 18 +++ .../fixSignatureCaching.errors.txt | 12 +- .../fixSignatureCaching.errors.txt.diff | 31 +++++ .../jsDeclarationsExportDefinePropertyEmit.js | 8 +- ...clarationsExportDefinePropertyEmit.js.diff | 8 +- ...larationsModuleReferenceHasEmit.errors.txt | 4 +- ...ionsModuleReferenceHasEmit.errors.txt.diff | 4 +- .../jsDeclarationsTypeReferences.js | 20 ++++ .../jsDeclarationsTypeReferences.js.diff | 22 +++- .../jsxAndTypeAssertion.errors.txt | 4 +- .../jsxAndTypeAssertion.errors.txt.diff | 18 +++ ...ntDeclarationListInLoopNoCrash3.errors.txt | 8 +- ...larationListInLoopNoCrash3.errors.txt.diff | 37 ++++++ ...ntDeclarationListInLoopNoCrash4.errors.txt | 4 +- ...larationListInLoopNoCrash4.errors.txt.diff | 20 ++++ .../library-reference-1.trace.json | 7 -- .../library-reference-10.trace.json | 9 -- .../library-reference-2.trace.json | 10 -- .../library-reference-6.trace.json | 6 - .../library-reference-8.trace.json | 14 --- .../noAssertForUnparseableTypedefs.errors.txt | 4 +- ...sertForUnparseableTypedefs.errors.txt.diff | 4 +- .../nodeModulesAtTypesPriority.trace.json | 14 --- .../conformance/parser509534.errors.txt | 8 +- .../conformance/parser509534.errors.txt.diff | 22 ++++ .../conformance/parser509693.errors.txt | 8 +- .../conformance/parser509693.errors.txt.diff | 17 +++ .../conformance/parser519458.errors.txt | 4 +- .../conformance/parser519458.errors.txt.diff | 18 +++ .../conformance/parser521128.errors.txt | 4 +- .../conformance/parser521128.errors.txt.diff | 15 +++ .../parserCommaInTypeMemberList2.errors.txt | 4 +- ...rserCommaInTypeMemberList2.errors.txt.diff | 13 +++ .../conformance/parserharness.errors.txt | 8 +- .../conformance/parserharness.errors.txt.diff | 22 +++- ...stic1(moduleresolution=bundler).trace.json | 10 -- ...ostic1(moduleresolution=node16).trace.json | 10 -- .../templateStringInModuleName.errors.txt | 8 +- ...templateStringInModuleName.errors.txt.diff | 31 +++++ .../templateStringInModuleNameES6.errors.txt | 8 +- ...plateStringInModuleNameES6.errors.txt.diff | 31 +++++ .../typeFromPropertyAssignment37.errors.txt | 4 +- ...peFromPropertyAssignment37.errors.txt.diff | 4 +- .../conformance/typingsLookup1.trace.json | 6 - .../conformance/typingsLookup3.errors.txt | 5 +- .../typingsLookup3.errors.txt.diff | 21 ++++ .../conformance/typingsLookup3.symbols | 9 +- .../conformance/typingsLookup3.symbols.diff | 17 +++ .../conformance/typingsLookup3.trace.json | 6 - .../conformance/typingsLookup3.types | 7 +- .../conformance/typingsLookup3.types.diff | 14 +++ .../conformance/typingsLookup4.trace.json | 41 ------- .../conformance/typingsSuggestion2.errors.txt | 4 +- .../typingsSuggestion2.errors.txt.diff | 15 +++ .../typingsSuggestionBun2.errors.txt | 4 +- .../typingsSuggestionBun2.errors.txt.diff | 15 +++ ...encesUmdModuleAsGlobalConst.baseline.jsonc | 4 - ...UmdModuleAsGlobalConst.baseline.jsonc.diff | 13 --- .../with-config-with-libReplacement.js | 8 -- .../tsbuild/libraryResolution/with-config.js | 8 -- ...iffers-between-projects-for-shared-file.js | 24 ---- ...t-resolution-options-referenced-project.js | 107 ++++++++++-------- .../with-config-with-libReplacement.js | 8 -- .../libraryResolution/with-config.js | 8 -- ...types-found-doesnt-crash-under---strict.js | 52 ++++++--- ...ith-no-backing-types-found-doesnt-crash.js | 20 +--- .../with-config-with-libReplacement.js | 8 -- .../tsc/libraryResolution/with-config.js | 8 -- 156 files changed, 1826 insertions(+), 773 deletions(-) create mode 100644 testdata/baselines/reference/submodule/compiler/anonymousModules.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/didYouMeanSuggestionErrors.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/externModule.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/innerModExport1.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/innerModExport2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/metadataImportType.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleExports1.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleKeywordRepeatError.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.symbols.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.types.diff create mode 100644 testdata/baselines/reference/submodule/compiler/overloadingStaticFunctionsInFunctions.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/parseInvalidNames.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.js.diff create mode 100644 testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.symbols.diff create mode 100644 testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.types.diff create mode 100644 testdata/baselines/reference/submodule/compiler/reservedWords2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/staticsInAFunction.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.js.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.js.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.js.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.symbols.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.types.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.symbols.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.types.diff create mode 100644 testdata/baselines/reference/submodule/compiler/typecheckIfCondition.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/fixSignatureCaching.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/jsxAndTypeAssertion.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/labeledStatementDeclarationListInLoopNoCrash3.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/labeledStatementDeclarationListInLoopNoCrash4.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parser509534.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parser509693.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parser519458.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parser521128.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserCommaInTypeMemberList2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/templateStringInModuleName.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/templateStringInModuleNameES6.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typingsLookup3.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typingsLookup3.symbols.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typingsLookup3.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typingsSuggestion2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/typingsSuggestionBun2.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc.diff diff --git a/internal/checker/checker.go b/internal/checker/checker.go index b8639053eb..77322e8226 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -13529,21 +13529,21 @@ func (c *Checker) getCannotFindNameDiagnosticForName(node *ast.Node) *diagnostic case "document", "console": return diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom case "$": - return core.IfElse(c.compilerOptions.Types != nil, - diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig, - diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery) + return core.IfElse(c.compilerOptions.UsesWildcardTypes(), + diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery, + diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig) case "describe", "suite", "it", "test": - return core.IfElse(c.compilerOptions.Types != nil, - diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig, - diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha) + return core.IfElse(c.compilerOptions.UsesWildcardTypes(), + diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha, + diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig) case "process", "require", "Buffer", "module": - return core.IfElse(c.compilerOptions.Types != nil, - diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig, - diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode) + return core.IfElse(c.compilerOptions.UsesWildcardTypes(), + diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode, + diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig) case "Bun": - return core.IfElse(c.compilerOptions.Types != nil, - diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig, - diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun) + return core.IfElse(c.compilerOptions.UsesWildcardTypes(), + diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun, + diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig) case "Map", "Set", "Promise", "ast.Symbol", "WeakMap", "WeakSet", "Iterator", "AsyncIterator", "SharedArrayBuffer", "Atomics", "AsyncIterable", "AsyncIterableIterator", "AsyncGenerator", "AsyncGeneratorFunction", "BigInt", "Reflect", "BigInt64Array", "BigUint64Array": return diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later diff --git a/internal/compiler/fileInclude.go b/internal/compiler/fileInclude.go index 180ec81a52..aacf73ca72 100644 --- a/internal/compiler/fileInclude.go +++ b/internal/compiler/fileInclude.go @@ -191,7 +191,7 @@ func (r *FileIncludeReason) computeDiagnostic(program *Program, toFileName func( } case fileIncludeKindAutomaticTypeDirectiveFile: data := r.asAutomaticTypeDirectiveFileData() - if program.Options().Types != nil { + if !program.Options().UsesWildcardTypes() { if data.packageId.Name != "" { return ast.NewCompilerDiagnostic(diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1, data.typeReference, data.packageId.String()) } else { @@ -277,7 +277,7 @@ func (r *FileIncludeReason) toRelatedInfo(program *Program) *ast.Diagnostic { } } case fileIncludeKindAutomaticTypeDirectiveFile: - if program.Options().Types != nil { + if !program.Options().UsesWildcardTypes() { data := r.asAutomaticTypeDirectiveFileData() if typesSyntax := tsoptions.GetOptionsSyntaxByArrayElementValue(program.includeProcessor.getCompilerOptionsObjectLiteralSyntax(program), "types", data.typeReference); typesSyntax != nil { return tsoptions.CreateDiagnosticForNodeInSourceFile(config.ConfigFile.SourceFile, typesSyntax.AsNode(), diagnostics.File_is_entry_point_of_type_library_specified_here) diff --git a/internal/core/compileroptions.go b/internal/core/compileroptions.go index 815c052e94..5995b38a0f 100644 --- a/internal/core/compileroptions.go +++ b/internal/core/compileroptions.go @@ -2,6 +2,7 @@ package core import ( "reflect" + "slices" "strings" "sync" @@ -328,6 +329,11 @@ func (options *CompilerOptions) GetEffectiveTypeRoots(currentDirectory string) ( return typeRoots, false } +// UsesWildcardTypes returns true if this option's types array includes "*" +func (options *CompilerOptions) UsesWildcardTypes() bool { + return slices.Contains(options.Types, "*") +} + func (options *CompilerOptions) GetIsolatedModules() bool { return options.IsolatedModules == TSTrue || options.VerbatimModuleSyntax == TSTrue } diff --git a/internal/fourslash/_scripts/failingTests.txt b/internal/fourslash/_scripts/failingTests.txt index b0f71eb5ae..24621952e6 100644 --- a/internal/fourslash/_scripts/failingTests.txt +++ b/internal/fourslash/_scripts/failingTests.txt @@ -21,11 +21,11 @@ TestAutoImportNodeNextJSRequire TestAutoImportPackageJsonImportsCaseSensitivity TestAutoImportPackageRootPath TestAutoImportPathsNodeModules +TestAutoImportProvider9 TestAutoImportProvider_exportMap2 TestAutoImportProvider_exportMap5 TestAutoImportProvider_exportMap9 TestAutoImportProvider_globalTypingsCache -TestAutoImportProvider9 TestAutoImportRelativePathToMonorepoPackage TestAutoImportSortCaseSensitivity1 TestAutoImportTypeImport1 @@ -62,6 +62,7 @@ TestCompletionForComputedStringProperties TestCompletionForMetaProperty TestCompletionForObjectProperty TestCompletionForStringLiteral +TestCompletionForStringLiteral4 TestCompletionForStringLiteral_quotePreference TestCompletionForStringLiteral_quotePreference1 TestCompletionForStringLiteral_quotePreference2 @@ -71,7 +72,6 @@ TestCompletionForStringLiteral_quotePreference5 TestCompletionForStringLiteral_quotePreference6 TestCompletionForStringLiteral_quotePreference7 TestCompletionForStringLiteral_quotePreference8 -TestCompletionForStringLiteral4 TestCompletionImportMeta TestCompletionImportMetaWithGlobalDeclaration TestCompletionImportModuleSpecifierEndingUnsupportedExtension @@ -102,16 +102,16 @@ TestCompletionListInUnclosedTaggedTemplate02 TestCompletionListInUnclosedTemplate01 TestCompletionListInUnclosedTemplate02 TestCompletionListInvalidMemberNames +TestCompletionListInvalidMemberNames2 TestCompletionListInvalidMemberNames_escapeQuote TestCompletionListInvalidMemberNames_startWithSpace TestCompletionListInvalidMemberNames_withExistingIdentifier -TestCompletionListInvalidMemberNames2 TestCompletionListOfGenericSymbol TestCompletionListOnAliases -TestCompletionListsStringLiteralTypeAsIndexedAccessTypeObject TestCompletionListStringParenthesizedExpression TestCompletionListStringParenthesizedType TestCompletionListWithoutVariableinitializer +TestCompletionListsStringLiteralTypeAsIndexedAccessTypeObject TestCompletionNoAutoInsertQuestionDotForThis TestCompletionNoAutoInsertQuestionDotForTypeParameter TestCompletionNoAutoInsertQuestionDotWithUserPreferencesOff @@ -123,6 +123,7 @@ TestCompletionOfAwaitPromise6 TestCompletionOfAwaitPromise7 TestCompletionOfInterfaceAndVar TestCompletionPreferredSuggestions1 +TestCompletionWithConditionalOperatorMissingColon TestCompletionsAfterJSDoc TestCompletionsBeforeRestArg1 TestCompletionsClassMemberImportTypeNodeParameter1 @@ -132,6 +133,7 @@ TestCompletionsClassMemberImportTypeNodeParameter4 TestCompletionsElementAccessNumeric TestCompletionsExportImport TestCompletionsGenericTypeWithMultipleBases1 +TestCompletionsImportOrExportSpecifier TestCompletionsImport_default_alreadyExistedWithRename TestCompletionsImport_default_anonymous TestCompletionsImport_details_withMisspelledName @@ -150,10 +152,11 @@ TestCompletionsImport_reExport_wrongName TestCompletionsImport_require_addToExisting TestCompletionsImport_typeOnly TestCompletionsImport_umdDefaultNoCrash1 +TestCompletionsImport_umdModules1_globalAccess +TestCompletionsImport_umdModules3_script TestCompletionsImport_uriStyleNodeCoreModules2 TestCompletionsImport_uriStyleNodeCoreModules3 TestCompletionsImport_windowsPathsProjectRelative -TestCompletionsImportOrExportSpecifier TestCompletionsInExport TestCompletionsInExport_moduleBlock TestCompletionsJSDocNoCrash1 @@ -182,14 +185,13 @@ TestCompletionsStringsWithTriggerCharacter TestCompletionsSymbolMembers TestCompletionsTriggerCharacter TestCompletionsTuple -TestCompletionsUniqueSymbol_import TestCompletionsUniqueSymbol1 +TestCompletionsUniqueSymbol_import TestCompletionsWithDeprecatedTag10 -TestCompletionWithConditionalOperatorMissingColon TestConstEnumQuickInfoAndCompletionList TestConstQuickInfoAndCompletionList -TestContextuallyTypedFunctionExpressionGeneric1 TestContextualTypingOfGenericCallSignatures2 +TestContextuallyTypedFunctionExpressionGeneric1 TestCrossFileQuickInfoExportedTypeDoesNotUseImportType TestDoubleUnderscoreCompletions TestEditJsdocType @@ -229,6 +231,10 @@ TestFormatRemoveNewLineAfterOpenBrace TestFormatSpaceAfterImplementsExtends TestFormatSpaceAfterTemplateHeadAndMiddle TestFormatSpaceBetweenFunctionAndArrayIndex +TestFormatTryFinally +TestFormatTsxClosingAfterJsxText +TestFormatVariableDeclarationList +TestFormatWithStatement TestFormattingAfterMultiLineIfCondition TestFormattingAwait TestFormattingChainingMethods @@ -254,8 +260,8 @@ TestFormattingObjectLiteralOpenCurlySingleLine TestFormattingOfExportDefault TestFormattingOnClasses TestFormattingOnClosingBracket -TestFormattingOnDocumentReadyFunction TestFormattingOnDoWhileNoSemicolon +TestFormattingOnDocumentReadyFunction TestFormattingOnEmptyInterfaceLiteral TestFormattingOnInvalidCodes TestFormattingOnModuleIndentation @@ -272,21 +278,17 @@ TestFormattingSpaceBetweenParent TestFormattingSpacesAfterConstructor TestFormattingTemplates TestFormattingVoid -TestFormatTryFinally -TestFormatTsxClosingAfterJsxText -TestFormatVariableDeclarationList -TestFormatWithStatement TestFunctionIndentation TestFunctionTypePredicateFormatting TestFunduleWithRecursiveReference -TestGenericCombinators3 TestGenericCombinatorWithConstraints1 +TestGenericCombinators3 TestGenericFunctionWithGenericParams1 TestGenericInterfacePropertyInference1 TestGenericInterfacePropertyInference2 TestGenericInterfacesWithConstraints1 -TestGenericsFormattingMultiline TestGenericTypeWithMultipleBases1MultiFile +TestGenericsFormattingMultiline TestGetJavaScriptCompletions10 TestGetJavaScriptCompletions12 TestGetJavaScriptCompletions13 @@ -307,26 +309,6 @@ TestGetJavaScriptSyntacticDiagnostics24 TestHoverOverComment TestImportFixesGlobalTypingsCache TestImportMetaCompletionDetails -TestImportNameCodeFix_avoidRelativeNodeModules -TestImportNameCodeFix_externalNonRelative1 -TestImportNameCodeFix_fileWithNoTrailingNewline -TestImportNameCodeFix_HeaderComment1 -TestImportNameCodeFix_HeaderComment2 -TestImportNameCodeFix_importType1 -TestImportNameCodeFix_importType2 -TestImportNameCodeFix_importType7 -TestImportNameCodeFix_importType8 -TestImportNameCodeFix_jsx1 -TestImportNameCodeFix_noDestructureNonObjectLiteral -TestImportNameCodeFix_order -TestImportNameCodeFix_order2 -TestImportNameCodeFix_preferBaseUrl -TestImportNameCodeFix_reExportDefault -TestImportNameCodeFix_symlink -TestImportNameCodeFix_trailingComma -TestImportNameCodeFix_uriStyleNodeCoreModules2 -TestImportNameCodeFix_uriStyleNodeCoreModules3 -TestImportNameCodeFix_withJson TestImportNameCodeFixDefaultExport4 TestImportNameCodeFixExistingImport10 TestImportNameCodeFixExistingImport11 @@ -345,6 +327,26 @@ TestImportNameCodeFixNewImportFileQuoteStyle2 TestImportNameCodeFixNewImportFileQuoteStyleMixed0 TestImportNameCodeFixNewImportFileQuoteStyleMixed1 TestImportNameCodeFixNewImportTypeRoots1 +TestImportNameCodeFix_HeaderComment1 +TestImportNameCodeFix_HeaderComment2 +TestImportNameCodeFix_avoidRelativeNodeModules +TestImportNameCodeFix_externalNonRelative1 +TestImportNameCodeFix_fileWithNoTrailingNewline +TestImportNameCodeFix_importType1 +TestImportNameCodeFix_importType2 +TestImportNameCodeFix_importType7 +TestImportNameCodeFix_importType8 +TestImportNameCodeFix_jsx1 +TestImportNameCodeFix_noDestructureNonObjectLiteral +TestImportNameCodeFix_order +TestImportNameCodeFix_order2 +TestImportNameCodeFix_preferBaseUrl +TestImportNameCodeFix_reExportDefault +TestImportNameCodeFix_symlink +TestImportNameCodeFix_trailingComma +TestImportNameCodeFix_uriStyleNodeCoreModules2 +TestImportNameCodeFix_uriStyleNodeCoreModules3 +TestImportNameCodeFix_withJson TestImportStatementCompletions_esModuleInterop2 TestImportStatementCompletions_noSnippet TestImportStatementCompletions_pnpm1 @@ -365,7 +367,6 @@ TestJavascriptModules20 TestJavascriptModules24 TestJsDocAugments TestJsDocAugmentsAndExtends -TestJsdocCallbackTag TestJsDocExtends TestJsDocFunctionSignatures10 TestJsDocFunctionSignatures11 @@ -388,20 +389,21 @@ TestJsDocPropertyDescription8 TestJsDocPropertyDescription9 TestJsDocServices TestJsDocTagsWithHyphen +TestJsFileImportNoTypes2 +TestJsQuickInfoGenerallyAcceptableSize +TestJsRequireQuickInfo +TestJsdocCallbackTag TestJsdocTemplatePrototypeCompletions TestJsdocThrowsTagCompletion TestJsdocTypedefTag TestJsdocTypedefTag2 TestJsdocTypedefTagNamespace TestJsdocTypedefTagServices -TestJsFileImportNoTypes2 -TestJsQuickInfoGenerallyAcceptableSize -TestJsRequireQuickInfo TestJsxAttributeCompletionStyleAuto TestJsxAttributeCompletionStyleBraces TestJsxAttributeCompletionStyleDefault -TestJsxAttributeCompletionStyleNone TestJsxAttributeCompletionStyleNoSnippet +TestJsxAttributeCompletionStyleNone TestJsxAttributeSnippetCompletionAfterTypeArgs TestJsxAttributeSnippetCompletionClosed TestJsxAttributeSnippetCompletionUnclosed @@ -410,8 +412,8 @@ TestLocalFunction TestMemberListInReopenedEnum TestMemberListInWithBlock TestMemberListOfExportedClass -TestMultilineCommentBeforeOpenBrace TestMultiModuleFundule +TestMultilineCommentBeforeOpenBrace TestNgProxy1 TestNgProxy4 TestNoQuickInfoForLabel @@ -423,15 +425,13 @@ TestParameterWithDestructuring TestParameterWithNestedDestructuring TestProtoVarVisibleWithOuterScopeUnderscoreProto TestQualifyModuleTypeNames -TestQuickInfo_notInsideComment -TestQuickinfo01 TestQuickInfoAssertionNodeNotReusedWhenTypeNotEquivalent1 TestQuickInfoBindingPatternInJsdocNoCrash1 TestQuickInfoCanBeTruncated TestQuickInfoClassKeyword TestQuickInfoCloduleWithRecursiveReference -TestQuickInfoContextuallyTypedSignatureOptionalParameterFromIntersection1 TestQuickInfoContextualTyping +TestQuickInfoContextuallyTypedSignatureOptionalParameterFromIntersection1 TestQuickInfoDisplayPartsIife TestQuickInfoElementAccessDeclaration TestQuickInfoForConstTypeReference @@ -444,15 +444,13 @@ TestQuickInfoForGenericTaggedTemplateExpression TestQuickInfoForGetterAndSetter TestQuickInfoForIndexerResultWithConstraint TestQuickInfoForNamedTupleMember -TestQuickinfoForNamespaceMergeWithClassConstrainedToSelf TestQuickInfoForObjectBindingElementPropertyName04 TestQuickInfoForShorthandProperty TestQuickInfoForSyntaxErrorNoError -TestQuickInfoForTypeofParameter TestQuickInfoForTypeParameterInTypeAlias1 TestQuickInfoForTypeParameterInTypeAlias2 +TestQuickInfoForTypeofParameter TestQuickInfoForUMDModuleAlias -TestQuickinfoForUnionProperty TestQuickInfoFunctionKeyword TestQuickInfoGenerics TestQuickInfoGetterSetter @@ -461,13 +459,13 @@ TestQuickInfoInJsdocInTsFile1 TestQuickInfoInOptionalChain TestQuickInfoInWithBlock TestQuickInfoJSDocBackticks -TestQuickInfoJsdocEnum TestQuickInfoJSDocFunctionNew TestQuickInfoJSDocFunctionThis +TestQuickInfoJSExport TestQuickInfoJsDocGetterSetterNoCrash1 TestQuickInfoJsDocNonDiscriminatedUnionSharedProp +TestQuickInfoJsdocEnum TestQuickInfoJsdocTypedefMissingType -TestQuickInfoJSExport TestQuickInfoMappedSpreadTypes TestQuickInfoMappedType TestQuickInfoMappedTypeRecursiveInference @@ -511,7 +509,6 @@ TestQuickInfoOnUndefined TestQuickInfoOnVarInArrowExpression TestQuickInfoPrivateIdentifierInTypeReferenceNoCrash1 TestQuickInfoPropertyTag -TestQuickInforForSucessiveInferencesIsNotAny TestQuickInfoSignatureOptionalParameterFromUnion1 TestQuickInfoSignatureRestParameterFromUnion1 TestQuickInfoSignatureRestParameterFromUnion2 @@ -527,6 +524,11 @@ TestQuickInfoTypeOnlyNamespaceAndClass TestQuickInfoUnionOfNamespaces TestQuickInfoUntypedModuleImport TestQuickInfoWidenedTypes +TestQuickInfo_notInsideComment +TestQuickInforForSucessiveInferencesIsNotAny +TestQuickinfo01 +TestQuickinfoForNamespaceMergeWithClassConstrainedToSelf +TestQuickinfoForUnionProperty TestQuickinfoWrongComment TestRecursiveInternalModuleImport TestReferencesInEmptyFile diff --git a/internal/module/resolver.go b/internal/module/resolver.go index d520941ab9..8912eb3268 100644 --- a/internal/module/resolver.go +++ b/internal/module/resolver.go @@ -1976,11 +1976,15 @@ func ResolveConfig(moduleName string, containingFile string, host ResolutionHost } func GetAutomaticTypeDirectiveNames(options *core.CompilerOptions, host ResolutionHost) []string { - if options.Types != nil { - return options.Types + if !options.UsesWildcardTypes() { + if options.Types != nil { + return options.Types + } + return []string{} } - var result []string + // Walk the primary type lookup locations + var wildcardMatches []string typeRoots, _ := options.GetEffectiveTypeRoots(host.GetCurrentDirectory()) for _, root := range typeRoots { if host.FS().DirectoryExists(root) { @@ -1998,13 +2002,24 @@ func GetAutomaticTypeDirectiveNames(options *core.CompilerOptions, host Resoluti if !isNotNeededPackage { baseFileName := tspath.GetBaseFileName(normalized) if !strings.HasPrefix(baseFileName, ".") { - result = append(result, baseFileName) + wildcardMatches = append(wildcardMatches, baseFileName) } } } } } - return result + + // Order potentially matters in program construction, so substitute + // in the wildcard in the position it was specified in the types array + var result []string + for _, t := range options.Types { + if t == "*" { + result = append(result, wildcardMatches...) + } else { + result = append(result, t) + } + } + return core.Deduplicate(result) } type ResolvedEntrypoints struct { diff --git a/testdata/baselines/reference/submodule/compiler/anonymousModules.errors.txt b/testdata/baselines/reference/submodule/compiler/anonymousModules.errors.txt index 9ed762464d..80b3447b5d 100644 --- a/testdata/baselines/reference/submodule/compiler/anonymousModules.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/anonymousModules.errors.txt @@ -1,22 +1,22 @@ -anonymousModules.ts(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +anonymousModules.ts(1,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. anonymousModules.ts(1,8): error TS1437: Namespace must be given a name. -anonymousModules.ts(4,2): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +anonymousModules.ts(4,2): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. anonymousModules.ts(4,9): error TS1437: Namespace must be given a name. -anonymousModules.ts(10,2): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +anonymousModules.ts(10,2): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. anonymousModules.ts(10,9): error TS1437: Namespace must be given a name. ==== anonymousModules.ts (6 errors) ==== module { ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1437: Namespace must be given a name. export var foo = 1; module { ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1437: Namespace must be given a name. export var bar = 1; @@ -26,7 +26,7 @@ anonymousModules.ts(10,9): error TS1437: Namespace must be given a name. module { ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1437: Namespace must be given a name. var x = bar; diff --git a/testdata/baselines/reference/submodule/compiler/anonymousModules.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/anonymousModules.errors.txt.diff new file mode 100644 index 0000000000..f9a91ee646 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/anonymousModules.errors.txt.diff @@ -0,0 +1,39 @@ +--- old.anonymousModules.errors.txt ++++ new.anonymousModules.errors.txt +@@= skipped -0, +0 lines =@@ +-anonymousModules.ts(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++anonymousModules.ts(1,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + anonymousModules.ts(1,8): error TS1437: Namespace must be given a name. +-anonymousModules.ts(4,2): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++anonymousModules.ts(4,2): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + anonymousModules.ts(4,9): error TS1437: Namespace must be given a name. +-anonymousModules.ts(10,2): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++anonymousModules.ts(10,2): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + anonymousModules.ts(10,9): error TS1437: Namespace must be given a name. + + + ==== anonymousModules.ts (6 errors) ==== + module { + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1437: Namespace must be given a name. + export var foo = 1; + + module { + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1437: Namespace must be given a name. + export var bar = 1; +@@= skipped -25, +25 lines =@@ + + module { + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1437: Namespace must be given a name. + var x = bar; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt index 5e9dbe5981..beb0276bc1 100644 --- a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt @@ -1,5 +1,5 @@ constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'. -constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected. constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. @@ -105,7 +105,7 @@ constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or ~~~~~~ !!! error TS2503: Cannot find namespace 'module'. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1005: ';' expected. diff --git a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff index 93585e0d06..f2a5711e94 100644 --- a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff @@ -1,5 +1,12 @@ --- old.constructorWithIncompleteTypeAnnotation.errors.txt +++ new.constructorWithIncompleteTypeAnnotation.errors.txt +@@= skipped -0, +0 lines =@@ + constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'. +-constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. + constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected. + constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. @@= skipped -38, +38 lines =@@ constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '{' expected. constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'. @@ -18,7 +25,16 @@ constructorWithIncompleteTypeAnnotation.ts(235,27): error TS1005: ',' expected. constructorWithIncompleteTypeAnnotation.ts(235,28): error TS2693: 'number' only refers to a type, but is being used as a value here. constructorWithIncompleteTypeAnnotation.ts(235,36): error TS1005: ';' expected. -@@= skipped -169, +169 lines =@@ +@@= skipped -53, +53 lines =@@ + ~~~~~~ + !!! error TS2503: Cannot find namespace 'module'. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1005: ';' expected. + +@@= skipped -116, +116 lines =@@ var undef = undefined; var _\uD4A5\u7204\uC316\uE59F = local; diff --git a/testdata/baselines/reference/submodule/compiler/didYouMeanSuggestionErrors.errors.txt b/testdata/baselines/reference/submodule/compiler/didYouMeanSuggestionErrors.errors.txt index c109c19fe7..a51a1d701d 100644 --- a/testdata/baselines/reference/submodule/compiler/didYouMeanSuggestionErrors.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/didYouMeanSuggestionErrors.errors.txt @@ -1,14 +1,14 @@ -didYouMeanSuggestionErrors.ts(1,1): error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. -didYouMeanSuggestionErrors.ts(2,5): error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. -didYouMeanSuggestionErrors.ts(3,19): error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`. -didYouMeanSuggestionErrors.ts(7,1): error TS2582: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. -didYouMeanSuggestionErrors.ts(8,5): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +didYouMeanSuggestionErrors.ts(1,1): error TS2593: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. +didYouMeanSuggestionErrors.ts(2,5): error TS2593: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. +didYouMeanSuggestionErrors.ts(3,19): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. +didYouMeanSuggestionErrors.ts(7,1): error TS2593: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. +didYouMeanSuggestionErrors.ts(8,5): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. didYouMeanSuggestionErrors.ts(9,9): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. -didYouMeanSuggestionErrors.ts(9,21): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +didYouMeanSuggestionErrors.ts(9,21): error TS2591: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. didYouMeanSuggestionErrors.ts(10,9): error TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. -didYouMeanSuggestionErrors.ts(12,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -didYouMeanSuggestionErrors.ts(13,19): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -didYouMeanSuggestionErrors.ts(14,19): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +didYouMeanSuggestionErrors.ts(12,19): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +didYouMeanSuggestionErrors.ts(13,19): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +didYouMeanSuggestionErrors.ts(14,19): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. didYouMeanSuggestionErrors.ts(16,23): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. didYouMeanSuggestionErrors.ts(17,23): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. didYouMeanSuggestionErrors.ts(18,23): error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. @@ -22,40 +22,40 @@ didYouMeanSuggestionErrors.ts(24,18): error TS2583: Cannot find name 'AsyncItera ==== didYouMeanSuggestionErrors.ts (19 errors) ==== describe("my test suite", () => { ~~~~~~~~ -!!! error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. it("should run", () => { ~~ -!!! error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. const a = $(".thing"); ~ -!!! error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`. +!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. }); }); suite("another suite", () => { ~~~~~ -!!! error TS2582: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. test("everything else", () => { ~~~~ -!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. console.log(process.env); ~~~~~~~ !!! error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. ~~~~~~~ -!!! error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. document.createElement("div"); ~~~~~~~~ !!! error TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. const x = require("fs"); ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. const y = Buffer.from([]); ~~~~~~ -!!! error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. const z = module.exports; ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. const a = new Map(); ~~~ diff --git a/testdata/baselines/reference/submodule/compiler/didYouMeanSuggestionErrors.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/didYouMeanSuggestionErrors.errors.txt.diff new file mode 100644 index 0000000000..5cce8ab4b5 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/didYouMeanSuggestionErrors.errors.txt.diff @@ -0,0 +1,76 @@ +--- old.didYouMeanSuggestionErrors.errors.txt ++++ new.didYouMeanSuggestionErrors.errors.txt +@@= skipped -0, +0 lines =@@ +-didYouMeanSuggestionErrors.ts(1,1): error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +-didYouMeanSuggestionErrors.ts(2,5): error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +-didYouMeanSuggestionErrors.ts(3,19): error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`. +-didYouMeanSuggestionErrors.ts(7,1): error TS2582: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +-didYouMeanSuggestionErrors.ts(8,5): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++didYouMeanSuggestionErrors.ts(1,1): error TS2593: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. ++didYouMeanSuggestionErrors.ts(2,5): error TS2593: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. ++didYouMeanSuggestionErrors.ts(3,19): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ++didYouMeanSuggestionErrors.ts(7,1): error TS2593: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. ++didYouMeanSuggestionErrors.ts(8,5): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + didYouMeanSuggestionErrors.ts(9,9): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. +-didYouMeanSuggestionErrors.ts(9,21): error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++didYouMeanSuggestionErrors.ts(9,21): error TS2591: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + didYouMeanSuggestionErrors.ts(10,9): error TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. +-didYouMeanSuggestionErrors.ts(12,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-didYouMeanSuggestionErrors.ts(13,19): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-didYouMeanSuggestionErrors.ts(14,19): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++didYouMeanSuggestionErrors.ts(12,19): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ++didYouMeanSuggestionErrors.ts(13,19): error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ++didYouMeanSuggestionErrors.ts(14,19): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + didYouMeanSuggestionErrors.ts(16,23): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. + didYouMeanSuggestionErrors.ts(17,23): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. + didYouMeanSuggestionErrors.ts(18,23): error TS2583: Cannot find name 'WeakMap'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later. +@@= skipped -21, +21 lines =@@ + ==== didYouMeanSuggestionErrors.ts (19 errors) ==== + describe("my test suite", () => { + ~~~~~~~~ +-!!! error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + it("should run", () => { + ~~ +-!!! error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + const a = $(".thing"); + ~ +-!!! error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`. ++!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + }); + }); + + suite("another suite", () => { + ~~~~~ +-!!! error TS2582: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'suite'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + test("everything else", () => { + ~~~~ +-!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + console.log(process.env); + ~~~~~~~ + !!! error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. + ~~~~~~~ +-!!! error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + document.createElement("div"); + ~~~~~~~~ + !!! error TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'. + + const x = require("fs"); + ~~~~~~~ +-!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + const y = Buffer.from([]); + ~~~~~~ +-!!! error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + const z = module.exports; + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + + const a = new Map(); + ~~~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt index ccd73fdb24..6a7e54d2d5 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt @@ -1,4 +1,4 @@ -index.js(3,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(3,23): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== index.js (1 errors) ==== @@ -6,7 +6,7 @@ index.js(3,23): error TS2580: Cannot find name 'module'. Do you need to install module.exports = 12; Object.defineProperty(module, "exports", { value: "oh no" }); ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== namespacey.js (0 errors) ==== const A = {} diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff index db3cbbf2cf..1a85233adf 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff @@ -6,7 +6,7 @@ - - -==== index.js (0 errors) ==== -+index.js(3,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(3,23): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + + +==== index.js (1 errors) ==== @@ -14,7 +14,7 @@ module.exports = 12; Object.defineProperty(module, "exports", { value: "oh no" }); + ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== namespacey.js (0 errors) ==== const A = {} diff --git a/testdata/baselines/reference/submodule/compiler/externModule.errors.txt b/testdata/baselines/reference/submodule/compiler/externModule.errors.txt index 5d933216d1..3a1ac80845 100644 --- a/testdata/baselines/reference/submodule/compiler/externModule.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/externModule.errors.txt @@ -1,5 +1,5 @@ externModule.ts(1,1): error TS2304: Cannot find name 'declare'. -externModule.ts(1,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +externModule.ts(1,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. externModule.ts(1,16): error TS1437: Namespace must be given a name. externModule.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration. externModule.ts(4,10): error TS2391: Function implementation is missing or not immediately following the declaration. @@ -18,7 +18,7 @@ externModule.ts(37,3): error TS2552: Cannot find name 'XDate'. Did you mean 'Dat ~~~~~~~ !!! error TS2304: Cannot find name 'declare'. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1437: Namespace must be given a name. export class XDate { diff --git a/testdata/baselines/reference/submodule/compiler/externModule.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/externModule.errors.txt.diff new file mode 100644 index 0000000000..f343373321 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/externModule.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.externModule.errors.txt ++++ new.externModule.errors.txt +@@= skipped -0, +0 lines =@@ + externModule.ts(1,1): error TS2304: Cannot find name 'declare'. +-externModule.ts(1,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++externModule.ts(1,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + externModule.ts(1,16): error TS1437: Namespace must be given a name. + externModule.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration. + externModule.ts(4,10): error TS2391: Function implementation is missing or not immediately following the declaration. +@@= skipped -17, +17 lines =@@ + ~~~~~~~ + !!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1437: Namespace must be given a name. + export class XDate { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/innerModExport1.errors.txt b/testdata/baselines/reference/submodule/compiler/innerModExport1.errors.txt index 1aa62fd7d5..8e2973bcd8 100644 --- a/testdata/baselines/reference/submodule/compiler/innerModExport1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/innerModExport1.errors.txt @@ -1,4 +1,4 @@ -innerModExport1.ts(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +innerModExport1.ts(5,5): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. innerModExport1.ts(5,12): error TS1437: Namespace must be given a name. @@ -9,7 +9,7 @@ innerModExport1.ts(5,12): error TS1437: Namespace must be given a name. var non_export_var: number; module { ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1437: Namespace must be given a name. var non_export_var = 0; diff --git a/testdata/baselines/reference/submodule/compiler/innerModExport1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/innerModExport1.errors.txt.diff new file mode 100644 index 0000000000..71b424cf96 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/innerModExport1.errors.txt.diff @@ -0,0 +1,17 @@ +--- old.innerModExport1.errors.txt ++++ new.innerModExport1.errors.txt +@@= skipped -0, +0 lines =@@ +-innerModExport1.ts(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++innerModExport1.ts(5,5): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + innerModExport1.ts(5,12): error TS1437: Namespace must be given a name. + + +@@= skipped -8, +8 lines =@@ + var non_export_var: number; + module { + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1437: Namespace must be given a name. + var non_export_var = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/innerModExport2.errors.txt b/testdata/baselines/reference/submodule/compiler/innerModExport2.errors.txt index 8ee2da64c1..546a8f5652 100644 --- a/testdata/baselines/reference/submodule/compiler/innerModExport2.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/innerModExport2.errors.txt @@ -1,4 +1,4 @@ -innerModExport2.ts(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +innerModExport2.ts(5,5): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. innerModExport2.ts(5,12): error TS1437: Namespace must be given a name. innerModExport2.ts(7,20): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local. innerModExport2.ts(13,9): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local. @@ -12,7 +12,7 @@ innerModExport2.ts(20,7): error TS2551: Property 'NonExportFunc' does not exist var non_export_var: number; module { ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1437: Namespace must be given a name. var non_export_var = 0; diff --git a/testdata/baselines/reference/submodule/compiler/innerModExport2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/innerModExport2.errors.txt.diff new file mode 100644 index 0000000000..5f0427be70 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/innerModExport2.errors.txt.diff @@ -0,0 +1,17 @@ +--- old.innerModExport2.errors.txt ++++ new.innerModExport2.errors.txt +@@= skipped -0, +0 lines =@@ +-innerModExport2.ts(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++innerModExport2.ts(5,5): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + innerModExport2.ts(5,12): error TS1437: Namespace must be given a name. + innerModExport2.ts(7,20): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local. + innerModExport2.ts(13,9): error TS2395: Individual declarations in merged declaration 'export_var' must be all exported or all local. +@@= skipped -11, +11 lines =@@ + var non_export_var: number; + module { + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1437: Namespace must be given a name. + var non_export_var = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/metadataImportType.errors.txt b/testdata/baselines/reference/submodule/compiler/metadataImportType.errors.txt index 3b229d7992..7e49c9df95 100644 --- a/testdata/baselines/reference/submodule/compiler/metadataImportType.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/metadataImportType.errors.txt @@ -1,4 +1,4 @@ -metadataImportType.ts(2,6): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +metadataImportType.ts(2,6): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. metadataImportType.ts(3,15): error TS2307: Cannot find module './b' or its corresponding type declarations. @@ -6,7 +6,7 @@ metadataImportType.ts(3,15): error TS2307: Cannot find module './b' or its corre export class A { @test ~~~~ -!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. b: import('./b').B ~~~~~ !!! error TS2307: Cannot find module './b' or its corresponding type declarations. diff --git a/testdata/baselines/reference/submodule/compiler/metadataImportType.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/metadataImportType.errors.txt.diff new file mode 100644 index 0000000000..a08634451f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/metadataImportType.errors.txt.diff @@ -0,0 +1,17 @@ +--- old.metadataImportType.errors.txt ++++ new.metadataImportType.errors.txt +@@= skipped -0, +0 lines =@@ +-metadataImportType.ts(2,6): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++metadataImportType.ts(2,6): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + metadataImportType.ts(3,15): error TS2307: Cannot find module './b' or its corresponding type declarations. + + +@@= skipped -5, +5 lines =@@ + export class A { + @test + ~~~~ +-!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + b: import('./b').B + ~~~~~ + !!! error TS2307: Cannot find module './b' or its corresponding type declarations. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleExports1.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleExports1.errors.txt index 94e406a313..6413aa71b7 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleExports1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/moduleExports1.errors.txt @@ -2,8 +2,8 @@ moduleExports1.ts(1,1): error TS1185: Merge conflict marker encountered. moduleExports1.ts(3,1): error TS1185: Merge conflict marker encountered. moduleExports1.ts(5,1): error TS1185: Merge conflict marker encountered. moduleExports1.ts(7,1): error TS1185: Merge conflict marker encountered. -moduleExports1.ts(19,6): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -moduleExports1.ts(19,22): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +moduleExports1.ts(19,6): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +moduleExports1.ts(19,22): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== moduleExports1.ts (6 errors) ==== @@ -35,6 +35,6 @@ moduleExports1.ts(19,22): error TS2580: Cannot find name 'module'. Do you need t if (!module.exports) module.exports = ""; ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleExports1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleExports1.errors.txt.diff new file mode 100644 index 0000000000..adbca8e3c0 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleExports1.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.moduleExports1.errors.txt ++++ new.moduleExports1.errors.txt +@@= skipped -1, +1 lines =@@ + moduleExports1.ts(3,1): error TS1185: Merge conflict marker encountered. + moduleExports1.ts(5,1): error TS1185: Merge conflict marker encountered. + moduleExports1.ts(7,1): error TS1185: Merge conflict marker encountered. +-moduleExports1.ts(19,6): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-moduleExports1.ts(19,22): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++moduleExports1.ts(19,6): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ++moduleExports1.ts(19,22): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + + + ==== moduleExports1.ts (6 errors) ==== +@@= skipped -33, +33 lines =@@ + + if (!module.exports) module.exports = ""; + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleKeywordRepeatError.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleKeywordRepeatError.errors.txt index 4fa11a7263..6076da1513 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleKeywordRepeatError.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/moduleKeywordRepeatError.errors.txt @@ -1,4 +1,4 @@ -moduleKeywordRepeatError.ts(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +moduleKeywordRepeatError.ts(3,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. moduleKeywordRepeatError.ts(3,15): error TS1005: ';' expected. @@ -7,6 +7,6 @@ moduleKeywordRepeatError.ts(3,15): error TS1005: ';' expected. module.module { } ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleKeywordRepeatError.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleKeywordRepeatError.errors.txt.diff new file mode 100644 index 0000000000..e85750c33e --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleKeywordRepeatError.errors.txt.diff @@ -0,0 +1,16 @@ +--- old.moduleKeywordRepeatError.errors.txt ++++ new.moduleKeywordRepeatError.errors.txt +@@= skipped -0, +0 lines =@@ +-moduleKeywordRepeatError.ts(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++moduleKeywordRepeatError.ts(3,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + moduleKeywordRepeatError.ts(3,15): error TS1005: ';' expected. + + +@@= skipped -6, +6 lines =@@ + + module.module { } + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve3.trace.json b/testdata/baselines/reference/submodule/compiler/modulePreserve3.trace.json index d730dd7f5e..9c1dafca93 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve3.trace.json +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve3.trace.json @@ -8,17 +8,3 @@ File '/node_modules/@types/react/package.json' does not exist. File '/node_modules/@types/react/jsx-runtime.d.ts' exists - use it as a name resolution result. Resolving real path for '/node_modules/@types/react/jsx-runtime.d.ts', result '/node_modules/@types/react/jsx-runtime.d.ts'. ======== Module name 'react/jsx-runtime' was successfully resolved to '/node_modules/@types/react/jsx-runtime.d.ts'. ======== -======== Resolving type reference directive 'react', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. -Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. -File '/node_modules/@types/react/package.json' does not exist according to earlier cached lookups. -File '/node_modules/@types/react/index.d.ts' does not exist. -Looking up in 'node_modules' folder, initial location '/.src'. -Searching all ancestor node_modules directories for preferred extensions: Declaration. -Directory '/.src/node_modules' does not exist, skipping all lookups in it. -Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. -File '/node_modules/react.d.ts' does not exist. -File '/node_modules/@types/react/package.json' does not exist according to earlier cached lookups. -File '/node_modules/@types/react.d.ts' does not exist. -File '/node_modules/@types/react/index.d.ts' does not exist according to earlier cached lookups. -======== Type reference directive 'react' was not resolved. ======== diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt b/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt index 2a64d7ccfa..36ac9d5916 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt @@ -1,9 +1,9 @@ /f.cts(1,1): error TS1286: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. -/main1.ts(3,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/main1.ts(3,12): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. /main1.ts(19,4): error TS2339: Property 'default' does not exist on type '() => void'. /main1.ts(23,8): error TS1192: Module '"/e"' has no default export. /main2.mts(4,4): error TS2339: Property 'default' does not exist on type 'typeof import("/a")'. -/main2.mts(5,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/main2.mts(5,12): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. /main2.mts(14,8): error TS1192: Module '"/e"' has no default export. /main3.cjs(1,10): error TS1293: ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. /main3.cjs(1,13): error TS1293: ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. @@ -47,7 +47,7 @@ import a1 = require("./a"); // { x: 0 } const a2 = require("./a"); // Error in TS ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. const a3 = await import("./a"); // { x: 0 } a3.x; @@ -91,7 +91,7 @@ !!! error TS2339: Property 'default' does not exist on type 'typeof import("/a")'. const a2 = require("./a"); // Error in TS ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. import b1 from "./b"; // 0 import b2 = require("./b"); // { default: 0 } diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt.diff index 63b7095c89..577d50c307 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt.diff @@ -4,12 +4,14 @@ -/a.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /f.cts(1,1): error TS1286: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. -/main1.ts(1,13): error TS2305: Module '"./a"' has no exported member 'y'. - /main1.ts(3,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-/main1.ts(3,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++/main1.ts(3,12): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. /main1.ts(19,4): error TS2339: Property 'default' does not exist on type '() => void'. /main1.ts(23,8): error TS1192: Module '"/e"' has no default export. -/main2.mts(1,13): error TS2305: Module '"./a"' has no exported member 'y'. /main2.mts(4,4): error TS2339: Property 'default' does not exist on type 'typeof import("/a")'. - /main2.mts(5,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-/main2.mts(5,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++/main2.mts(5,12): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. /main2.mts(14,8): error TS1192: Module '"/e"' has no default export. /main3.cjs(1,10): error TS1293: ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. -/main3.cjs(1,13): error TS2305: Module '"./a"' has no exported member 'y'. @@ -42,6 +44,11 @@ import a1 = require("./a"); // { x: 0 } const a2 = require("./a"); // Error in TS ~~~~~~~ +-!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + const a3 = await import("./a"); // { x: 0 } + a3.x; + @@= skipped -42, +40 lines =@@ import g2 = require("./g"); // { default: 0 } g2.default; @@ -54,7 +61,16 @@ import a1 = require("./a"); // { x: 0 } a1.x; a1.default.x; // Arguably should exist but doesn't -@@= skipped -35, +33 lines =@@ +@@= skipped -11, +9 lines =@@ + !!! error TS2339: Property 'default' does not exist on type 'typeof import("/a")'. + const a2 = require("./a"); // Error in TS + ~~~~~~~ +-!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + + import b1 from "./b"; // 0 + import b2 = require("./b"); // { default: 0 } +@@= skipped -24, +24 lines =@@ ~ !!! error TS1293: ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. ~ diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.errors.txt new file mode 100644 index 0000000000..d29804366c --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.errors.txt @@ -0,0 +1,14 @@ +/a.ts(1,1): error TS2304: Cannot find name 'a'. + + +==== /a.ts (1 errors) ==== + a; + ~ +!!! error TS2304: Cannot find name 'a'. + +==== /node_modules/@types/.a/index.d.ts (0 errors) ==== + declare const a: number; + +==== /node_modules/@types/a/index.d.ts (0 errors) ==== + declare const a: string; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.errors.txt.diff new file mode 100644 index 0000000000..0261e827eb --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.moduleResolution_automaticTypeDirectiveNames.errors.txt ++++ new.moduleResolution_automaticTypeDirectiveNames.errors.txt +@@= skipped -0, +0 lines =@@ +- ++/a.ts(1,1): error TS2304: Cannot find name 'a'. ++ ++ ++==== /a.ts (1 errors) ==== ++ a; ++ ~ ++!!! error TS2304: Cannot find name 'a'. ++ ++==== /node_modules/@types/.a/index.d.ts (0 errors) ==== ++ declare const a: number; ++ ++==== /node_modules/@types/a/index.d.ts (0 errors) ==== ++ declare const a: string; ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.symbols b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.symbols index 43dc30b3cd..5066216987 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.symbols +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.symbols @@ -1,10 +1,6 @@ //// [tests/cases/compiler/moduleResolution_automaticTypeDirectiveNames.ts] //// === /a.ts === -a; ->a : Symbol(a, Decl(index.d.ts, 0, 13)) -=== /node_modules/@types/a/index.d.ts === -declare const a: string; ->a : Symbol(a, Decl(index.d.ts, 0, 13)) +a; diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.symbols.diff b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.symbols.diff new file mode 100644 index 0000000000..577a3eb1b4 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.symbols.diff @@ -0,0 +1,13 @@ +--- old.moduleResolution_automaticTypeDirectiveNames.symbols ++++ new.moduleResolution_automaticTypeDirectiveNames.symbols +@@= skipped -0, +0 lines =@@ + //// [tests/cases/compiler/moduleResolution_automaticTypeDirectiveNames.ts] //// + + === /a.ts === +-a; +->a : Symbol(a, Decl(index.d.ts, 0, 13)) + +-=== /node_modules/@types/a/index.d.ts === +-declare const a: string; +->a : Symbol(a, Decl(index.d.ts, 0, 13)) ++a; diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.types b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.types index b928140158..19fc4b6dce 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.types +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.types @@ -2,9 +2,5 @@ === /a.ts === a; ->a : string - -=== /node_modules/@types/a/index.d.ts === -declare const a: string; ->a : string +>a : any diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.types.diff b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.types.diff new file mode 100644 index 0000000000..13c397edcb --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_automaticTypeDirectiveNames.types.diff @@ -0,0 +1,12 @@ +--- old.moduleResolution_automaticTypeDirectiveNames.types ++++ new.moduleResolution_automaticTypeDirectiveNames.types +@@= skipped -1, +1 lines =@@ + + === /a.ts === + a; +->a : string +- +-=== /node_modules/@types/a/index.d.ts === +-declare const a: string; +->a : string ++>a : any diff --git a/testdata/baselines/reference/submodule/compiler/overloadingStaticFunctionsInFunctions.errors.txt b/testdata/baselines/reference/submodule/compiler/overloadingStaticFunctionsInFunctions.errors.txt index 0480862a9f..04f5d04cf1 100644 --- a/testdata/baselines/reference/submodule/compiler/overloadingStaticFunctionsInFunctions.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/overloadingStaticFunctionsInFunctions.errors.txt @@ -1,13 +1,13 @@ overloadingStaticFunctionsInFunctions.ts(1,14): error TS1005: '(' expected. overloadingStaticFunctionsInFunctions.ts(2,3): error TS1128: Declaration or statement expected. -overloadingStaticFunctionsInFunctions.ts(2,10): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +overloadingStaticFunctionsInFunctions.ts(2,10): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. overloadingStaticFunctionsInFunctions.ts(3,3): error TS1128: Declaration or statement expected. -overloadingStaticFunctionsInFunctions.ts(3,10): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +overloadingStaticFunctionsInFunctions.ts(3,10): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. overloadingStaticFunctionsInFunctions.ts(3,15): error TS2304: Cannot find name 'name'. overloadingStaticFunctionsInFunctions.ts(3,19): error TS1005: ',' expected. overloadingStaticFunctionsInFunctions.ts(3,20): error TS2693: 'string' only refers to a type, but is being used as a value here. overloadingStaticFunctionsInFunctions.ts(4,3): error TS1128: Declaration or statement expected. -overloadingStaticFunctionsInFunctions.ts(4,10): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +overloadingStaticFunctionsInFunctions.ts(4,10): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. overloadingStaticFunctionsInFunctions.ts(4,15): error TS2304: Cannot find name 'name'. overloadingStaticFunctionsInFunctions.ts(4,20): error TS1109: Expression expected. overloadingStaticFunctionsInFunctions.ts(4,21): error TS2693: 'any' only refers to a type, but is being used as a value here. @@ -22,12 +22,12 @@ overloadingStaticFunctionsInFunctions.ts(4,25): error TS1005: ';' expected. ~~~~~~ !!! error TS1128: Declaration or statement expected. ~~~~ -!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. static test(name:string) ~~~~~~ !!! error TS1128: Declaration or statement expected. ~~~~ -!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. ~~~~ !!! error TS2304: Cannot find name 'name'. ~ @@ -38,7 +38,7 @@ overloadingStaticFunctionsInFunctions.ts(4,25): error TS1005: ';' expected. ~~~~~~ !!! error TS1128: Declaration or statement expected. ~~~~ -!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. ~~~~ !!! error TS2304: Cannot find name 'name'. ~ diff --git a/testdata/baselines/reference/submodule/compiler/overloadingStaticFunctionsInFunctions.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/overloadingStaticFunctionsInFunctions.errors.txt.diff new file mode 100644 index 0000000000..b5434b5b53 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/overloadingStaticFunctionsInFunctions.errors.txt.diff @@ -0,0 +1,43 @@ +--- old.overloadingStaticFunctionsInFunctions.errors.txt ++++ new.overloadingStaticFunctionsInFunctions.errors.txt +@@= skipped -0, +0 lines =@@ + overloadingStaticFunctionsInFunctions.ts(1,14): error TS1005: '(' expected. + overloadingStaticFunctionsInFunctions.ts(2,3): error TS1128: Declaration or statement expected. +-overloadingStaticFunctionsInFunctions.ts(2,10): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++overloadingStaticFunctionsInFunctions.ts(2,10): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + overloadingStaticFunctionsInFunctions.ts(3,3): error TS1128: Declaration or statement expected. +-overloadingStaticFunctionsInFunctions.ts(3,10): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++overloadingStaticFunctionsInFunctions.ts(3,10): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + overloadingStaticFunctionsInFunctions.ts(3,15): error TS2304: Cannot find name 'name'. + overloadingStaticFunctionsInFunctions.ts(3,19): error TS1005: ',' expected. + overloadingStaticFunctionsInFunctions.ts(3,20): error TS2693: 'string' only refers to a type, but is being used as a value here. + overloadingStaticFunctionsInFunctions.ts(4,3): error TS1128: Declaration or statement expected. +-overloadingStaticFunctionsInFunctions.ts(4,10): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++overloadingStaticFunctionsInFunctions.ts(4,10): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + overloadingStaticFunctionsInFunctions.ts(4,15): error TS2304: Cannot find name 'name'. + overloadingStaticFunctionsInFunctions.ts(4,20): error TS1109: Expression expected. + overloadingStaticFunctionsInFunctions.ts(4,21): error TS2693: 'any' only refers to a type, but is being used as a value here. +@@= skipped -21, +21 lines =@@ + ~~~~~~ + !!! error TS1128: Declaration or statement expected. + ~~~~ +-!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + static test(name:string) + ~~~~~~ + !!! error TS1128: Declaration or statement expected. + ~~~~ +-!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + ~~~~ + !!! error TS2304: Cannot find name 'name'. + ~ +@@= skipped -16, +16 lines =@@ + ~~~~~~ + !!! error TS1128: Declaration or statement expected. + ~~~~ +-!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + ~~~~ + !!! error TS2304: Cannot find name 'name'. + ~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/parseInvalidNames.errors.txt b/testdata/baselines/reference/submodule/compiler/parseInvalidNames.errors.txt index ed80329cc0..f8c603edd4 100644 --- a/testdata/baselines/reference/submodule/compiler/parseInvalidNames.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/parseInvalidNames.errors.txt @@ -4,7 +4,7 @@ parseInvalidNames.ts(1,15): error TS1005: ';' expected. parseInvalidNames.ts(2,1): error TS2304: Cannot find name 'interface'. parseInvalidNames.ts(2,11): error TS2427: Interface name cannot be '100'. parseInvalidNames.ts(2,15): error TS1005: ';' expected. -parseInvalidNames.ts(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +parseInvalidNames.ts(3,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. parseInvalidNames.ts(3,8): error TS2819: Namespace name cannot be '100'. parseInvalidNames.ts(3,12): error TS1005: ';' expected. parseInvalidNames.ts(4,1): error TS2304: Cannot find name 'type'. @@ -19,7 +19,7 @@ parseInvalidNames.ts(7,8): error TS2304: Cannot find name 'interface'. parseInvalidNames.ts(7,18): error TS2427: Interface name cannot be '100'. parseInvalidNames.ts(7,22): error TS1005: ';' expected. parseInvalidNames.ts(8,1): error TS1128: Declaration or statement expected. -parseInvalidNames.ts(8,8): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +parseInvalidNames.ts(8,8): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. parseInvalidNames.ts(8,15): error TS2819: Namespace name cannot be '100'. parseInvalidNames.ts(8,19): error TS1005: ';' expected. parseInvalidNames.ts(9,1): error TS1128: Declaration or statement expected. @@ -45,7 +45,7 @@ parseInvalidNames.ts(9,17): error TS1005: ';' expected. !!! error TS1005: ';' expected. module 100 {} ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~ !!! error TS2819: Namespace name cannot be '100'. ~ @@ -80,7 +80,7 @@ parseInvalidNames.ts(9,17): error TS1005: ';' expected. ~~~~~~ !!! error TS1128: Declaration or statement expected. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~ !!! error TS2819: Namespace name cannot be '100'. ~ diff --git a/testdata/baselines/reference/submodule/compiler/parseInvalidNames.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/parseInvalidNames.errors.txt.diff new file mode 100644 index 0000000000..e21f01dc60 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/parseInvalidNames.errors.txt.diff @@ -0,0 +1,38 @@ +--- old.parseInvalidNames.errors.txt ++++ new.parseInvalidNames.errors.txt +@@= skipped -3, +3 lines =@@ + parseInvalidNames.ts(2,1): error TS2304: Cannot find name 'interface'. + parseInvalidNames.ts(2,11): error TS2427: Interface name cannot be '100'. + parseInvalidNames.ts(2,15): error TS1005: ';' expected. +-parseInvalidNames.ts(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++parseInvalidNames.ts(3,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + parseInvalidNames.ts(3,8): error TS2819: Namespace name cannot be '100'. + parseInvalidNames.ts(3,12): error TS1005: ';' expected. + parseInvalidNames.ts(4,1): error TS2304: Cannot find name 'type'. +@@= skipped -15, +15 lines =@@ + parseInvalidNames.ts(7,18): error TS2427: Interface name cannot be '100'. + parseInvalidNames.ts(7,22): error TS1005: ';' expected. + parseInvalidNames.ts(8,1): error TS1128: Declaration or statement expected. +-parseInvalidNames.ts(8,8): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++parseInvalidNames.ts(8,8): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + parseInvalidNames.ts(8,15): error TS2819: Namespace name cannot be '100'. + parseInvalidNames.ts(8,19): error TS1005: ';' expected. + parseInvalidNames.ts(9,1): error TS1128: Declaration or statement expected. +@@= skipped -26, +26 lines =@@ + !!! error TS1005: ';' expected. + module 100 {} + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~ + !!! error TS2819: Namespace name cannot be '100'. + ~ +@@= skipped -35, +35 lines =@@ + ~~~~~~ + !!! error TS1128: Declaration or statement expected. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~ + !!! error TS2819: Namespace name cannot be '100'. + ~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.trace.json b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.trace.json index 9635b88549..4d90132ff2 100644 --- a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.trace.json +++ b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.trace.json @@ -31,12 +31,3 @@ File '/.src/node_modules/@types/react/package.json' exists according to earlier 'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. ======== Module name './' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts'. ======== -======== Resolving type reference directive 'react', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. -File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. -File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/.src/node_modules/@types/react/index.d.ts', result '/.src/node_modules/@types/react/index.d.ts'. -======== Type reference directive 'react' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.trace.json b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.trace.json index 2d00b3c69f..cb0492e3c4 100644 --- a/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.trace.json +++ b/testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNextEsm.trace.json @@ -31,12 +31,3 @@ File '/.src/node_modules/@types/react/package.json' exists according to earlier 'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. ======== Module name './' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts'. ======== -======== Resolving type reference directive 'react', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. -File '/.src/node_modules/@types/react/package.json' exists according to earlier cached lookups. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' has 'types' field 'index.d.ts' that references '/.src/node_modules/@types/react/index.d.ts'. -File '/.src/node_modules/@types/react/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/.src/node_modules/@types/react/index.d.ts', result '/.src/node_modules/@types/react/index.d.ts'. -======== Type reference directive 'react' was successfully resolved to '/.src/node_modules/@types/react/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.errors.txt b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.errors.txt new file mode 100644 index 0000000000..206f1d2fc6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.errors.txt @@ -0,0 +1,14 @@ +usage.ts(1,23): error TS2307: Cannot find module 'url' or its corresponding type declarations. + + +==== usage.ts (1 errors) ==== + import { parse } from "url"; + ~~~~~ +!!! error TS2307: Cannot find module 'url' or its corresponding type declarations. + export const thing = () => parse(); + +==== node_modules/@types/node/index.d.ts (0 errors) ==== + declare module "url" { + export class Url {} + export function parse(): Url; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.errors.txt.diff new file mode 100644 index 0000000000..fb8bf5ea05 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.referenceTypesPreferedToPathIfPossible.errors.txt ++++ new.referenceTypesPreferedToPathIfPossible.errors.txt +@@= skipped -0, +0 lines =@@ +- ++usage.ts(1,23): error TS2307: Cannot find module 'url' or its corresponding type declarations. ++ ++ ++==== usage.ts (1 errors) ==== ++ import { parse } from "url"; ++ ~~~~~ ++!!! error TS2307: Cannot find module 'url' or its corresponding type declarations. ++ export const thing = () => parse(); ++ ++==== node_modules/@types/node/index.d.ts (0 errors) ==== ++ declare module "url" { ++ export class Url {} ++ export function parse(): Url; ++ } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.js b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.js index 45f692eabd..ae33767f58 100644 --- a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.js +++ b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.js @@ -20,4 +20,4 @@ exports.thing = thing; //// [usage.d.ts] -export declare const thing: () => import("url").Url; +export declare const thing: () => any; diff --git a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.js.diff b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.js.diff new file mode 100644 index 0000000000..610ed981ef --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.js.diff @@ -0,0 +1,8 @@ +--- old.referenceTypesPreferedToPathIfPossible.js ++++ new.referenceTypesPreferedToPathIfPossible.js +@@= skipped -19, +19 lines =@@ + + + //// [usage.d.ts] +-export declare const thing: () => import("url").Url; ++export declare const thing: () => any; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.symbols b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.symbols index 97521d6d02..773b08850a 100644 --- a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.symbols +++ b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.symbols @@ -8,14 +8,3 @@ export const thing = () => parse(); >thing : Symbol(thing, Decl(usage.ts, 1, 12)) >parse : Symbol(parse, Decl(usage.ts, 0, 8)) -=== node_modules/@types/node/index.d.ts === -declare module "url" { ->"url" : Symbol("url", Decl(index.d.ts, 0, 0)) - - export class Url {} ->Url : Symbol(Url, Decl(index.d.ts, 0, 22)) - - export function parse(): Url; ->parse : Symbol(parse, Decl(index.d.ts, 1, 23)) ->Url : Symbol(Url, Decl(index.d.ts, 0, 22)) -} diff --git a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.symbols.diff b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.symbols.diff new file mode 100644 index 0000000000..cb2fa80ab1 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.symbols.diff @@ -0,0 +1,17 @@ +--- old.referenceTypesPreferedToPathIfPossible.symbols ++++ new.referenceTypesPreferedToPathIfPossible.symbols +@@= skipped -7, +7 lines =@@ + >thing : Symbol(thing, Decl(usage.ts, 1, 12)) + >parse : Symbol(parse, Decl(usage.ts, 0, 8)) + +-=== node_modules/@types/node/index.d.ts === +-declare module "url" { +->"url" : Symbol("url", Decl(index.d.ts, 0, 0)) +- +- export class Url {} +->Url : Symbol(Url, Decl(index.d.ts, 0, 22)) +- +- export function parse(): Url; +->parse : Symbol(parse, Decl(index.d.ts, 1, 23)) +->Url : Symbol(Url, Decl(index.d.ts, 0, 22)) +-} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.types b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.types index f8d15810c3..edaa9cfa8d 100644 --- a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.types +++ b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.types @@ -2,21 +2,11 @@ === usage.ts === import { parse } from "url"; ->parse : () => import("url").Url +>parse : any export const thing = () => parse(); ->thing : () => import("url").Url ->() => parse() : () => import("url").Url ->parse() : import("url").Url ->parse : () => import("url").Url +>thing : () => any +>() => parse() : () => any +>parse() : any +>parse : any -=== node_modules/@types/node/index.d.ts === -declare module "url" { ->"url" : typeof import("url") - - export class Url {} ->Url : Url - - export function parse(): Url; ->parse : () => Url -} diff --git a/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.types.diff b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.types.diff new file mode 100644 index 0000000000..ad7d041697 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/referenceTypesPreferedToPathIfPossible.types.diff @@ -0,0 +1,30 @@ +--- old.referenceTypesPreferedToPathIfPossible.types ++++ new.referenceTypesPreferedToPathIfPossible.types +@@= skipped -1, +1 lines =@@ + + === usage.ts === + import { parse } from "url"; +->parse : () => import("url").Url ++>parse : any + + export const thing = () => parse(); +->thing : () => import("url").Url +->() => parse() : () => import("url").Url +->parse() : import("url").Url +->parse : () => import("url").Url +- +-=== node_modules/@types/node/index.d.ts === +-declare module "url" { +->"url" : typeof import("url") +- +- export class Url {} +->Url : Url +- +- export function parse(): Url; +->parse : () => Url +-} ++>thing : () => any ++>() => parse() : () => any ++>parse() : any ++>parse : any ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reservedWords2.errors.txt b/testdata/baselines/reference/submodule/compiler/reservedWords2.errors.txt index 4686d7ff69..8c304f2af0 100644 --- a/testdata/baselines/reference/submodule/compiler/reservedWords2.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/reservedWords2.errors.txt @@ -1,6 +1,6 @@ reservedWords2.ts(1,8): error TS1109: Expression expected. reservedWords2.ts(1,14): error TS1005: '(' expected. -reservedWords2.ts(1,16): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +reservedWords2.ts(1,16): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. reservedWords2.ts(1,31): error TS1005: ')' expected. reservedWords2.ts(2,12): error TS2300: Duplicate identifier '(Missing)'. reservedWords2.ts(2,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations. @@ -14,7 +14,7 @@ reservedWords2.ts(5,9): error TS2300: Duplicate identifier '(Missing)'. reservedWords2.ts(5,9): error TS2567: Enum declarations can only merge with namespace or other enum declarations. reservedWords2.ts(5,10): error TS1359: Identifier expected. 'throw' is a reserved word that cannot be used here. reservedWords2.ts(5,18): error TS1005: '=>' expected. -reservedWords2.ts(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +reservedWords2.ts(6,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. reservedWords2.ts(6,8): error TS2819: Namespace name cannot be 'void'. reservedWords2.ts(7,11): error TS2300: Duplicate identifier '(Missing)'. reservedWords2.ts(7,11): error TS1005: ':' expected. @@ -42,7 +42,7 @@ reservedWords2.ts(12,17): error TS1138: Parameter declaration expected. ~ !!! error TS1005: '(' expected. ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1005: ')' expected. import * as while from "foo" @@ -75,7 +75,7 @@ reservedWords2.ts(12,17): error TS1138: Parameter declaration expected. !!! error TS1005: '=>' expected. module void {} ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~~ !!! error TS2819: Namespace name cannot be 'void'. var {while, return} = { while: 1, return: 2 }; diff --git a/testdata/baselines/reference/submodule/compiler/reservedWords2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/reservedWords2.errors.txt.diff new file mode 100644 index 0000000000..b5aaa768e9 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/reservedWords2.errors.txt.diff @@ -0,0 +1,37 @@ +--- old.reservedWords2.errors.txt ++++ new.reservedWords2.errors.txt +@@= skipped -0, +0 lines =@@ + reservedWords2.ts(1,8): error TS1109: Expression expected. + reservedWords2.ts(1,14): error TS1005: '(' expected. +-reservedWords2.ts(1,16): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++reservedWords2.ts(1,16): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + reservedWords2.ts(1,31): error TS1005: ')' expected. + reservedWords2.ts(2,12): error TS2300: Duplicate identifier '(Missing)'. + reservedWords2.ts(2,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +@@= skipped -13, +13 lines =@@ + reservedWords2.ts(5,9): error TS2567: Enum declarations can only merge with namespace or other enum declarations. + reservedWords2.ts(5,10): error TS1359: Identifier expected. 'throw' is a reserved word that cannot be used here. + reservedWords2.ts(5,18): error TS1005: '=>' expected. +-reservedWords2.ts(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++reservedWords2.ts(6,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + reservedWords2.ts(6,8): error TS2819: Namespace name cannot be 'void'. + reservedWords2.ts(7,11): error TS2300: Duplicate identifier '(Missing)'. + reservedWords2.ts(7,11): error TS1005: ':' expected. +@@= skipped -28, +28 lines =@@ + ~ + !!! error TS1005: '(' expected. + ~~~~~~~ +-!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1005: ')' expected. + import * as while from "foo" +@@= skipped -33, +33 lines =@@ + !!! error TS1005: '=>' expected. + module void {} + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~~ + !!! error TS2819: Namespace name cannot be 'void'. + var {while, return} = { while: 1, return: 2 }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/staticsInAFunction.errors.txt b/testdata/baselines/reference/submodule/compiler/staticsInAFunction.errors.txt index f7555f7aeb..98f5ecc7c2 100644 --- a/testdata/baselines/reference/submodule/compiler/staticsInAFunction.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/staticsInAFunction.errors.txt @@ -1,13 +1,13 @@ staticsInAFunction.ts(1,13): error TS1005: '(' expected. staticsInAFunction.ts(2,4): error TS1128: Declaration or statement expected. -staticsInAFunction.ts(2,11): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +staticsInAFunction.ts(2,11): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. staticsInAFunction.ts(3,4): error TS1128: Declaration or statement expected. -staticsInAFunction.ts(3,11): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +staticsInAFunction.ts(3,11): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. staticsInAFunction.ts(3,16): error TS2304: Cannot find name 'name'. staticsInAFunction.ts(3,20): error TS1005: ',' expected. staticsInAFunction.ts(3,21): error TS2693: 'string' only refers to a type, but is being used as a value here. staticsInAFunction.ts(4,4): error TS1128: Declaration or statement expected. -staticsInAFunction.ts(4,11): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +staticsInAFunction.ts(4,11): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. staticsInAFunction.ts(4,16): error TS2304: Cannot find name 'name'. staticsInAFunction.ts(4,21): error TS1109: Expression expected. staticsInAFunction.ts(4,22): error TS2693: 'any' only refers to a type, but is being used as a value here. @@ -22,12 +22,12 @@ staticsInAFunction.ts(4,26): error TS1005: ';' expected. ~~~~~~ !!! error TS1128: Declaration or statement expected. ~~~~ -!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. static test(name:string) ~~~~~~ !!! error TS1128: Declaration or statement expected. ~~~~ -!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. ~~~~ !!! error TS2304: Cannot find name 'name'. ~ @@ -38,7 +38,7 @@ staticsInAFunction.ts(4,26): error TS1005: ';' expected. ~~~~~~ !!! error TS1128: Declaration or statement expected. ~~~~ -!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. ~~~~ !!! error TS2304: Cannot find name 'name'. ~ diff --git a/testdata/baselines/reference/submodule/compiler/staticsInAFunction.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/staticsInAFunction.errors.txt.diff new file mode 100644 index 0000000000..162fe8caa8 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/staticsInAFunction.errors.txt.diff @@ -0,0 +1,43 @@ +--- old.staticsInAFunction.errors.txt ++++ new.staticsInAFunction.errors.txt +@@= skipped -0, +0 lines =@@ + staticsInAFunction.ts(1,13): error TS1005: '(' expected. + staticsInAFunction.ts(2,4): error TS1128: Declaration or statement expected. +-staticsInAFunction.ts(2,11): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++staticsInAFunction.ts(2,11): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + staticsInAFunction.ts(3,4): error TS1128: Declaration or statement expected. +-staticsInAFunction.ts(3,11): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++staticsInAFunction.ts(3,11): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + staticsInAFunction.ts(3,16): error TS2304: Cannot find name 'name'. + staticsInAFunction.ts(3,20): error TS1005: ',' expected. + staticsInAFunction.ts(3,21): error TS2693: 'string' only refers to a type, but is being used as a value here. + staticsInAFunction.ts(4,4): error TS1128: Declaration or statement expected. +-staticsInAFunction.ts(4,11): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++staticsInAFunction.ts(4,11): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + staticsInAFunction.ts(4,16): error TS2304: Cannot find name 'name'. + staticsInAFunction.ts(4,21): error TS1109: Expression expected. + staticsInAFunction.ts(4,22): error TS2693: 'any' only refers to a type, but is being used as a value here. +@@= skipped -21, +21 lines =@@ + ~~~~~~ + !!! error TS1128: Declaration or statement expected. + ~~~~ +-!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + static test(name:string) + ~~~~~~ + !!! error TS1128: Declaration or statement expected. + ~~~~ +-!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + ~~~~ + !!! error TS2304: Cannot find name 'name'. + ~ +@@= skipped -16, +16 lines =@@ + ~~~~~~ + !!! error TS1128: Declaration or statement expected. + ~~~~ +-!!! error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. ++!!! error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. + ~~~~ + !!! error TS2304: Cannot find name 'name'. + ~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt index 1e6ac9586c..d909c2706a 100644 --- a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt @@ -1,4 +1,4 @@ -a.js(3,12): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +a.js(3,12): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. a.js(4,5): error TS1231: An export assignment must be at the top level of a file or module declaration. @@ -7,7 +7,7 @@ a.js(4,5): error TS1231: An export assignment must be at the top level of a file if (typeof module === 'object' && module.exports) { ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. module.exports = fn; ~~~~~~ !!! error TS1231: An export assignment must be at the top level of a file or module declaration. diff --git a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt.diff index cdab0fee0a..51b9b2d4b9 100644 --- a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt.diff @@ -2,7 +2,7 @@ +++ new.truthinessCallExpressionCoercion4.errors.txt @@= skipped -0, +0 lines =@@ - -+a.js(3,12): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++a.js(3,12): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +a.js(4,5): error TS1231: An export assignment must be at the top level of a file or module declaration. + + @@ -11,7 +11,7 @@ + + if (typeof module === 'object' && module.exports) { + ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + module.exports = fn; + ~~~~~~ +!!! error TS1231: An export assignment must be at the top level of a file or module declaration. diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives1.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives1.trace.json index 84f7b4a4cf..77bdc49524 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives1.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives1.trace.json @@ -5,10 +5,3 @@ File '/types/lib/package.json' does not exist. File '/types/lib/index.d.ts' exists - use it as a name resolution result. Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. ======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== -======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ======== -Resolving with primary search path '/types'. -File '/types/lib.d.ts' does not exist according to earlier cached lookups. -File '/types/lib/package.json' does not exist according to earlier cached lookups. -File '/types/lib/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. -======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives10.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives10.trace.json index 052bcd8804..70f813fef8 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives10.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives10.trace.json @@ -13,10 +13,3 @@ File '/ref.ts' does not exist. File '/ref.tsx' does not exist. File '/ref.d.ts' exists - use it as a name resolution result. ======== Module name './ref' was successfully resolved to '/ref.d.ts'. ======== -======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ======== -Resolving with primary search path '/types'. -File '/types/lib.d.ts' does not exist according to earlier cached lookups. -File '/types/lib/package.json' does not exist according to earlier cached lookups. -File '/types/lib/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. -======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.js b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.js index c313b9a328..204f86ff7f 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.js +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.js @@ -23,3 +23,24 @@ Object.defineProperty(exports, "__esModule", { value: true }); export interface A { x: () => typeof $; } + + +//// [DtsFileErrors] + + +/app.d.ts(2,21): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + + +==== /app.d.ts (1 errors) ==== + export interface A { + x: () => typeof $; + ~ +!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + } + +==== /ref.d.ts (0 errors) ==== + export interface $ { x } + +==== /types/lib/index.d.ts (0 errors) ==== + declare let $: { x: number } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.js.diff b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.js.diff new file mode 100644 index 0000000000..58f98a55c3 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.js.diff @@ -0,0 +1,27 @@ +--- old.typeReferenceDirectives13.js ++++ new.typeReferenceDirectives13.js +@@= skipped -22, +22 lines =@@ + export interface A { + x: () => typeof $; + } ++ ++ ++//// [DtsFileErrors] ++ ++ ++/app.d.ts(2,21): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ++ ++ ++==== /app.d.ts (1 errors) ==== ++ export interface A { ++ x: () => typeof $; ++ ~ ++!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ++ } ++ ++==== /ref.d.ts (0 errors) ==== ++ export interface $ { x } ++ ++==== /types/lib/index.d.ts (0 errors) ==== ++ declare let $: { x: number } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.trace.json index 052bcd8804..70f813fef8 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives13.trace.json @@ -13,10 +13,3 @@ File '/ref.ts' does not exist. File '/ref.tsx' does not exist. File '/ref.d.ts' exists - use it as a name resolution result. ======== Module name './ref' was successfully resolved to '/ref.d.ts'. ======== -======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ======== -Resolving with primary search path '/types'. -File '/types/lib.d.ts' does not exist according to earlier cached lookups. -File '/types/lib/package.json' does not exist according to earlier cached lookups. -File '/types/lib/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. -======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives3.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives3.trace.json index 84f7b4a4cf..77bdc49524 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives3.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives3.trace.json @@ -5,10 +5,3 @@ File '/types/lib/package.json' does not exist. File '/types/lib/index.d.ts' exists - use it as a name resolution result. Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. ======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== -======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ======== -Resolving with primary search path '/types'. -File '/types/lib.d.ts' does not exist according to earlier cached lookups. -File '/types/lib/package.json' does not exist according to earlier cached lookups. -File '/types/lib/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. -======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives4.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives4.trace.json index 84f7b4a4cf..77bdc49524 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives4.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives4.trace.json @@ -5,10 +5,3 @@ File '/types/lib/package.json' does not exist. File '/types/lib/index.d.ts' exists - use it as a name resolution result. Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. ======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== -======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ======== -Resolving with primary search path '/types'. -File '/types/lib.d.ts' does not exist according to earlier cached lookups. -File '/types/lib/package.json' does not exist according to earlier cached lookups. -File '/types/lib/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. -======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.js b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.js index a25d608bcc..abb5193274 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.js +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.js @@ -22,3 +22,24 @@ Object.defineProperty(exports, "__esModule", { value: true }); export interface A { x: typeof $; } + + +//// [DtsFileErrors] + + +/app.d.ts(2,15): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + + +==== /app.d.ts (1 errors) ==== + export interface A { + x: typeof $; + ~ +!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + } + +==== /ref.d.ts (0 errors) ==== + export interface $ { x } + +==== /types/lib/index.d.ts (0 errors) ==== + declare let $: { x: number } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.js.diff b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.js.diff new file mode 100644 index 0000000000..18dd70d860 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.js.diff @@ -0,0 +1,27 @@ +--- old.typeReferenceDirectives5.js ++++ new.typeReferenceDirectives5.js +@@= skipped -21, +21 lines =@@ + export interface A { + x: typeof $; + } ++ ++ ++//// [DtsFileErrors] ++ ++ ++/app.d.ts(2,15): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ++ ++ ++==== /app.d.ts (1 errors) ==== ++ export interface A { ++ x: typeof $; ++ ~ ++!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ++ } ++ ++==== /ref.d.ts (0 errors) ==== ++ export interface $ { x } ++ ++==== /types/lib/index.d.ts (0 errors) ==== ++ declare let $: { x: number } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.trace.json index 052bcd8804..70f813fef8 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives5.trace.json @@ -13,10 +13,3 @@ File '/ref.ts' does not exist. File '/ref.tsx' does not exist. File '/ref.d.ts' exists - use it as a name resolution result. ======== Module name './ref' was successfully resolved to '/ref.d.ts'. ======== -======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ======== -Resolving with primary search path '/types'. -File '/types/lib.d.ts' does not exist according to earlier cached lookups. -File '/types/lib/package.json' does not exist according to earlier cached lookups. -File '/types/lib/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. -======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.js b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.js index 1959998feb..5c8d6a967e 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.js +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.js @@ -26,3 +26,27 @@ let y = () => x; //// [app.d.ts] declare let x: $; declare let y: () => $; + + +//// [DtsFileErrors] + + +/app.d.ts(1,16): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. +/app.d.ts(2,22): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + + +==== /app.d.ts (2 errors) ==== + declare let x: $; + ~ +!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + declare let y: () => $; + ~ +!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + +==== /ref.d.ts (0 errors) ==== + declare let $: { x: number } + +==== /types/lib/index.d.ts (0 errors) ==== + interface $ { x } + + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.js.diff b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.js.diff new file mode 100644 index 0000000000..a7a39e4398 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.js.diff @@ -0,0 +1,30 @@ +--- old.typeReferenceDirectives6.js ++++ new.typeReferenceDirectives6.js +@@= skipped -25, +25 lines =@@ + //// [app.d.ts] + declare let x: $; + declare let y: () => $; ++ ++ ++//// [DtsFileErrors] ++ ++ ++/app.d.ts(1,16): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ++/app.d.ts(2,22): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ++ ++ ++==== /app.d.ts (2 errors) ==== ++ declare let x: $; ++ ~ ++!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ++ declare let y: () => $; ++ ~ ++!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ++ ++==== /ref.d.ts (0 errors) ==== ++ declare let $: { x: number } ++ ++==== /types/lib/index.d.ts (0 errors) ==== ++ interface $ { x } ++ ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.trace.json index 84f7b4a4cf..77bdc49524 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives6.trace.json @@ -5,10 +5,3 @@ File '/types/lib/package.json' does not exist. File '/types/lib/index.d.ts' exists - use it as a name resolution result. Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. ======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== -======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ======== -Resolving with primary search path '/types'. -File '/types/lib.d.ts' does not exist according to earlier cached lookups. -File '/types/lib/package.json' does not exist according to earlier cached lookups. -File '/types/lib/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. -======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives7.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives7.trace.json index 84f7b4a4cf..77bdc49524 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives7.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives7.trace.json @@ -5,10 +5,3 @@ File '/types/lib/package.json' does not exist. File '/types/lib/index.d.ts' exists - use it as a name resolution result. Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. ======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== -======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ======== -Resolving with primary search path '/types'. -File '/types/lib.d.ts' does not exist according to earlier cached lookups. -File '/types/lib/package.json' does not exist according to earlier cached lookups. -File '/types/lib/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. -======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.js b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.js index 50d48c587a..f366e414ab 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.js +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.js @@ -76,3 +76,48 @@ import "./mod1"; export declare const cls: typeof Cls; export declare const foo: Lib; export declare const bar: Lib; + + +//// [DtsFileErrors] + + +/mod1.d.ts(3,16): error TS2304: Cannot find name 'Lib'. +/mod1.d.ts(6,25): error TS2304: Cannot find name 'Lib'. +/mod2.d.ts(4,27): error TS2304: Cannot find name 'Lib'. +/mod2.d.ts(5,27): error TS2304: Cannot find name 'Lib'. + + +==== /mod2.d.ts (2 errors) ==== + import { Cls } from "./main"; + import "./mod1"; + export declare const cls: typeof Cls; + export declare const foo: Lib; + ~~~ +!!! error TS2304: Cannot find name 'Lib'. + export declare const bar: Lib; + ~~~ +!!! error TS2304: Cannot find name 'Lib'. + +==== /types/lib/index.d.ts (0 errors) ==== + interface Lib { x } + +==== /main.d.ts (0 errors) ==== + export declare class Cls { + x: any; + } + +==== /mod1.d.ts (2 errors) ==== + declare module "./main" { + interface Cls { + foo(): Lib; + ~~~ +!!! error TS2304: Cannot find name 'Lib'. + } + namespace Cls { + function bar(): Lib; + ~~~ +!!! error TS2304: Cannot find name 'Lib'. + } + } + export {}; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.js.diff b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.js.diff index d809ae9f21..64c00c53e9 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.js.diff +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.js.diff @@ -7,4 +7,53 @@ + x; } exports.Cls = Cls; - //// [mod1.js] \ No newline at end of file + //// [mod1.js] +@@= skipped -39, +40 lines =@@ + export declare const cls: typeof Cls; + export declare const foo: Lib; + export declare const bar: Lib; ++ ++ ++//// [DtsFileErrors] ++ ++ ++/mod1.d.ts(3,16): error TS2304: Cannot find name 'Lib'. ++/mod1.d.ts(6,25): error TS2304: Cannot find name 'Lib'. ++/mod2.d.ts(4,27): error TS2304: Cannot find name 'Lib'. ++/mod2.d.ts(5,27): error TS2304: Cannot find name 'Lib'. ++ ++ ++==== /mod2.d.ts (2 errors) ==== ++ import { Cls } from "./main"; ++ import "./mod1"; ++ export declare const cls: typeof Cls; ++ export declare const foo: Lib; ++ ~~~ ++!!! error TS2304: Cannot find name 'Lib'. ++ export declare const bar: Lib; ++ ~~~ ++!!! error TS2304: Cannot find name 'Lib'. ++ ++==== /types/lib/index.d.ts (0 errors) ==== ++ interface Lib { x } ++ ++==== /main.d.ts (0 errors) ==== ++ export declare class Cls { ++ x: any; ++ } ++ ++==== /mod1.d.ts (2 errors) ==== ++ declare module "./main" { ++ interface Cls { ++ foo(): Lib; ++ ~~~ ++!!! error TS2304: Cannot find name 'Lib'. ++ } ++ namespace Cls { ++ function bar(): Lib; ++ ~~~ ++!!! error TS2304: Cannot find name 'Lib'. ++ } ++ } ++ export {}; ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.trace.json b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.trace.json index 87b47e2ca4..77a64fd192 100644 --- a/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeReferenceDirectives9.trace.json @@ -29,10 +29,3 @@ Resolving in CJS mode with conditions 'require', 'types'. Loading module as file / folder, candidate module location '/main', target file types: TypeScript, JavaScript, Declaration, JSON. File '/main.ts' exists - use it as a name resolution result. ======== Module name './main' was successfully resolved to '/main.ts'. ======== -======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ======== -Resolving with primary search path '/types'. -File '/types/lib.d.ts' does not exist according to earlier cached lookups. -File '/types/lib/package.json' does not exist according to earlier cached lookups. -File '/types/lib/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'. -======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.errors.txt b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.errors.txt new file mode 100644 index 0000000000..db6f88f823 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.errors.txt @@ -0,0 +1,35 @@ +/foo/bar/a.ts(1,19): error TS2307: Cannot find module 'xyz' or its corresponding type declarations. +/foo/bar/a.ts(2,19): error TS2307: Cannot find module 'pdq' or its corresponding type declarations. +/foo/bar/a.ts(3,19): error TS2307: Cannot find module 'abc' or its corresponding type declarations. + + +==== /foo/bar/tsconfig.json (0 errors) ==== + {} + +==== /foo/bar/a.ts (3 errors) ==== + import { x } from "xyz"; + ~~~~~ +!!! error TS2307: Cannot find module 'xyz' or its corresponding type declarations. + import { y } from "pdq"; + ~~~~~ +!!! error TS2307: Cannot find module 'pdq' or its corresponding type declarations. + import { z } from "abc"; + ~~~~~ +!!! error TS2307: Cannot find module 'abc' or its corresponding type declarations. + x + y + z; + +==== /node_modules/@types/dopey/index.d.ts (0 errors) ==== + declare module "xyz" { + export const x: number; + } + +==== /foo/node_modules/@types/grumpy/index.d.ts (0 errors) ==== + declare module "pdq" { + export const y: number; + } + +==== /foo/node_modules/@types/sneezy/index.d.ts (0 errors) ==== + declare module "abc" { + export const z: number; + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.errors.txt.diff new file mode 100644 index 0000000000..b02331642b --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.errors.txt.diff @@ -0,0 +1,39 @@ +--- old.typeRootsFromMultipleNodeModulesDirectories.errors.txt ++++ new.typeRootsFromMultipleNodeModulesDirectories.errors.txt +@@= skipped -0, +0 lines =@@ +- ++/foo/bar/a.ts(1,19): error TS2307: Cannot find module 'xyz' or its corresponding type declarations. ++/foo/bar/a.ts(2,19): error TS2307: Cannot find module 'pdq' or its corresponding type declarations. ++/foo/bar/a.ts(3,19): error TS2307: Cannot find module 'abc' or its corresponding type declarations. ++ ++ ++==== /foo/bar/tsconfig.json (0 errors) ==== ++ {} ++ ++==== /foo/bar/a.ts (3 errors) ==== ++ import { x } from "xyz"; ++ ~~~~~ ++!!! error TS2307: Cannot find module 'xyz' or its corresponding type declarations. ++ import { y } from "pdq"; ++ ~~~~~ ++!!! error TS2307: Cannot find module 'pdq' or its corresponding type declarations. ++ import { z } from "abc"; ++ ~~~~~ ++!!! error TS2307: Cannot find module 'abc' or its corresponding type declarations. ++ x + y + z; ++ ++==== /node_modules/@types/dopey/index.d.ts (0 errors) ==== ++ declare module "xyz" { ++ export const x: number; ++ } ++ ++==== /foo/node_modules/@types/grumpy/index.d.ts (0 errors) ==== ++ declare module "pdq" { ++ export const y: number; ++ } ++ ++==== /foo/node_modules/@types/sneezy/index.d.ts (0 errors) ==== ++ declare module "abc" { ++ export const z: number; ++ } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.symbols b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.symbols index b536c44585..de0abd89dc 100644 --- a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.symbols +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.symbols @@ -15,27 +15,3 @@ x + y + z; >y : Symbol(y, Decl(a.ts, 1, 8)) >z : Symbol(z, Decl(a.ts, 2, 8)) -=== /node_modules/@types/dopey/index.d.ts === -declare module "xyz" { ->"xyz" : Symbol("xyz", Decl(index.d.ts, 0, 0)) - - export const x: number; ->x : Symbol(x, Decl(index.d.ts, 1, 16)) -} - -=== /foo/node_modules/@types/grumpy/index.d.ts === -declare module "pdq" { ->"pdq" : Symbol("pdq", Decl(index.d.ts, 0, 0)) - - export const y: number; ->y : Symbol(y, Decl(index.d.ts, 1, 16)) -} - -=== /foo/node_modules/@types/sneezy/index.d.ts === -declare module "abc" { ->"abc" : Symbol("abc", Decl(index.d.ts, 0, 0)) - - export const z: number; ->z : Symbol(z, Decl(index.d.ts, 1, 16)) -} - diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.symbols.diff b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.symbols.diff new file mode 100644 index 0000000000..2add4f3b5d --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.symbols.diff @@ -0,0 +1,30 @@ +--- old.typeRootsFromMultipleNodeModulesDirectories.symbols ++++ new.typeRootsFromMultipleNodeModulesDirectories.symbols +@@= skipped -14, +14 lines =@@ + >y : Symbol(y, Decl(a.ts, 1, 8)) + >z : Symbol(z, Decl(a.ts, 2, 8)) + +-=== /node_modules/@types/dopey/index.d.ts === +-declare module "xyz" { +->"xyz" : Symbol("xyz", Decl(index.d.ts, 0, 0)) +- +- export const x: number; +->x : Symbol(x, Decl(index.d.ts, 1, 16)) +-} +- +-=== /foo/node_modules/@types/grumpy/index.d.ts === +-declare module "pdq" { +->"pdq" : Symbol("pdq", Decl(index.d.ts, 0, 0)) +- +- export const y: number; +->y : Symbol(y, Decl(index.d.ts, 1, 16)) +-} +- +-=== /foo/node_modules/@types/sneezy/index.d.ts === +-declare module "abc" { +->"abc" : Symbol("abc", Decl(index.d.ts, 0, 0)) +- +- export const z: number; +->z : Symbol(z, Decl(index.d.ts, 1, 16)) +-} +- \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.trace.json b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.trace.json index 4b61d20d97..25e7e5e03b 100644 --- a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.trace.json @@ -73,24 +73,3 @@ File '/foo/node_modules/abc.jsx' does not exist. File '/node_modules/abc.js' does not exist. File '/node_modules/abc.jsx' does not exist. ======== Module name 'abc' was not resolved. ======== -======== Resolving type reference directive 'grumpy', containing file '/foo/bar/__inferred type names__.ts', root directory '/foo/bar/node_modules/@types,/foo/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/foo/bar/node_modules/@types, /foo/node_modules/@types, /node_modules/@types'. -Directory '/foo/bar/node_modules/@types' does not exist, skipping all lookups in it. -File '/foo/node_modules/@types/grumpy/package.json' does not exist. -File '/foo/node_modules/@types/grumpy/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/foo/node_modules/@types/grumpy/index.d.ts', result '/foo/node_modules/@types/grumpy/index.d.ts'. -======== Type reference directive 'grumpy' was successfully resolved to '/foo/node_modules/@types/grumpy/index.d.ts', primary: true. ======== -======== Resolving type reference directive 'sneezy', containing file '/foo/bar/__inferred type names__.ts', root directory '/foo/bar/node_modules/@types,/foo/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/foo/bar/node_modules/@types, /foo/node_modules/@types, /node_modules/@types'. -Directory '/foo/bar/node_modules/@types' does not exist, skipping all lookups in it. -File '/foo/node_modules/@types/sneezy/package.json' does not exist. -File '/foo/node_modules/@types/sneezy/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/foo/node_modules/@types/sneezy/index.d.ts', result '/foo/node_modules/@types/sneezy/index.d.ts'. -======== Type reference directive 'sneezy' was successfully resolved to '/foo/node_modules/@types/sneezy/index.d.ts', primary: true. ======== -======== Resolving type reference directive 'dopey', containing file '/foo/bar/__inferred type names__.ts', root directory '/foo/bar/node_modules/@types,/foo/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/foo/bar/node_modules/@types, /foo/node_modules/@types, /node_modules/@types'. -Directory '/foo/bar/node_modules/@types' does not exist, skipping all lookups in it. -File '/node_modules/@types/dopey/package.json' does not exist. -File '/node_modules/@types/dopey/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/dopey/index.d.ts', result '/node_modules/@types/dopey/index.d.ts'. -======== Type reference directive 'dopey' was successfully resolved to '/node_modules/@types/dopey/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.types b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.types index 5dcad392f8..13fefaaac4 100644 --- a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.types +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.types @@ -2,42 +2,18 @@ === /foo/bar/a.ts === import { x } from "xyz"; ->x : number +>x : any import { y } from "pdq"; ->y : number +>y : any import { z } from "abc"; ->z : number +>z : any x + y + z; ->x + y + z : number ->x + y : number ->x : number ->y : number ->z : number - -=== /node_modules/@types/dopey/index.d.ts === -declare module "xyz" { ->"xyz" : typeof import("xyz") - - export const x: number; ->x : number -} - -=== /foo/node_modules/@types/grumpy/index.d.ts === -declare module "pdq" { ->"pdq" : typeof import("pdq") - - export const y: number; ->y : number -} - -=== /foo/node_modules/@types/sneezy/index.d.ts === -declare module "abc" { ->"abc" : typeof import("abc") - - export const z: number; ->z : number -} +>x + y + z : any +>x + y : any +>x : any +>y : any +>z : any diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.types.diff b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.types.diff new file mode 100644 index 0000000000..be26de4722 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromMultipleNodeModulesDirectories.types.diff @@ -0,0 +1,52 @@ +--- old.typeRootsFromMultipleNodeModulesDirectories.types ++++ new.typeRootsFromMultipleNodeModulesDirectories.types +@@= skipped -1, +1 lines =@@ + + === /foo/bar/a.ts === + import { x } from "xyz"; +->x : number ++>x : any + + import { y } from "pdq"; +->y : number ++>y : any + + import { z } from "abc"; +->z : number ++>z : any + + x + y + z; +->x + y + z : number +->x + y : number +->x : number +->y : number +->z : number +- +-=== /node_modules/@types/dopey/index.d.ts === +-declare module "xyz" { +->"xyz" : typeof import("xyz") +- +- export const x: number; +->x : number +-} +- +-=== /foo/node_modules/@types/grumpy/index.d.ts === +-declare module "pdq" { +->"pdq" : typeof import("pdq") +- +- export const y: number; +->y : number +-} +- +-=== /foo/node_modules/@types/sneezy/index.d.ts === +-declare module "abc" { +->"abc" : typeof import("abc") +- +- export const z: number; +->z : number +-} ++>x + y + z : any ++>x + y : any ++>x : any ++>y : any ++>z : any diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.errors.txt b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.errors.txt new file mode 100644 index 0000000000..d7d47d3902 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.errors.txt @@ -0,0 +1,17 @@ +/src/a.ts(1,19): error TS2307: Cannot find module 'xyz' or its corresponding type declarations. + + +==== /src/tsconfig.json (0 errors) ==== + {} + +==== /src/a.ts (1 errors) ==== + import { x } from "xyz"; + ~~~~~ +!!! error TS2307: Cannot find module 'xyz' or its corresponding type declarations. + x; + +==== /node_modules/@types/foo/index.d.ts (0 errors) ==== + declare module "xyz" { + export const x: number; + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.errors.txt.diff new file mode 100644 index 0000000000..f9143fd2d6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.errors.txt.diff @@ -0,0 +1,21 @@ +--- old.typeRootsFromNodeModulesInParentDirectory.errors.txt ++++ new.typeRootsFromNodeModulesInParentDirectory.errors.txt +@@= skipped -0, +0 lines =@@ +- ++/src/a.ts(1,19): error TS2307: Cannot find module 'xyz' or its corresponding type declarations. ++ ++ ++==== /src/tsconfig.json (0 errors) ==== ++ {} ++ ++==== /src/a.ts (1 errors) ==== ++ import { x } from "xyz"; ++ ~~~~~ ++!!! error TS2307: Cannot find module 'xyz' or its corresponding type declarations. ++ x; ++ ++==== /node_modules/@types/foo/index.d.ts (0 errors) ==== ++ declare module "xyz" { ++ export const x: number; ++ } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.symbols b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.symbols index 761a92a132..2f058735cf 100644 --- a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.symbols +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.symbols @@ -7,11 +7,3 @@ import { x } from "xyz"; x; >x : Symbol(x, Decl(a.ts, 0, 8)) -=== /node_modules/@types/foo/index.d.ts === -declare module "xyz" { ->"xyz" : Symbol("xyz", Decl(index.d.ts, 0, 0)) - - export const x: number; ->x : Symbol(x, Decl(index.d.ts, 1, 16)) -} - diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.symbols.diff b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.symbols.diff new file mode 100644 index 0000000000..de7220672e --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.symbols.diff @@ -0,0 +1,14 @@ +--- old.typeRootsFromNodeModulesInParentDirectory.symbols ++++ new.typeRootsFromNodeModulesInParentDirectory.symbols +@@= skipped -6, +6 lines =@@ + x; + >x : Symbol(x, Decl(a.ts, 0, 8)) + +-=== /node_modules/@types/foo/index.d.ts === +-declare module "xyz" { +->"xyz" : Symbol("xyz", Decl(index.d.ts, 0, 0)) +- +- export const x: number; +->x : Symbol(x, Decl(index.d.ts, 1, 16)) +-} +- \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.trace.json b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.trace.json index e9993d5ed5..3db23cc9b2 100644 --- a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.trace.json +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.trace.json @@ -16,10 +16,3 @@ Directory '/src/node_modules' does not exist, skipping all lookups in it. File '/node_modules/xyz.js' does not exist. File '/node_modules/xyz.jsx' does not exist. ======== Module name 'xyz' was not resolved. ======== -======== Resolving type reference directive 'foo', containing file '/src/__inferred type names__.ts', root directory '/src/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/src/node_modules/@types, /node_modules/@types'. -Directory '/src/node_modules/@types' does not exist, skipping all lookups in it. -File '/node_modules/@types/foo/package.json' does not exist. -File '/node_modules/@types/foo/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/foo/index.d.ts', result '/node_modules/@types/foo/index.d.ts'. -======== Type reference directive 'foo' was successfully resolved to '/node_modules/@types/foo/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.types b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.types index ccbc72cb84..0e35e38fec 100644 --- a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.types +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.types @@ -2,16 +2,8 @@ === /src/a.ts === import { x } from "xyz"; ->x : number +>x : any x; ->x : number - -=== /node_modules/@types/foo/index.d.ts === -declare module "xyz" { ->"xyz" : typeof import("xyz") - - export const x: number; ->x : number -} +>x : any diff --git a/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.types.diff b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.types.diff new file mode 100644 index 0000000000..367db3203d --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typeRootsFromNodeModulesInParentDirectory.types.diff @@ -0,0 +1,20 @@ +--- old.typeRootsFromNodeModulesInParentDirectory.types ++++ new.typeRootsFromNodeModulesInParentDirectory.types +@@= skipped -1, +1 lines =@@ + + === /src/a.ts === + import { x } from "xyz"; +->x : number ++>x : any + + x; +->x : number +- +-=== /node_modules/@types/foo/index.d.ts === +-declare module "xyz" { +->"xyz" : typeof import("xyz") +- +- export const x: number; +->x : number +-} ++>x : any diff --git a/testdata/baselines/reference/submodule/compiler/typecheckIfCondition.errors.txt b/testdata/baselines/reference/submodule/compiler/typecheckIfCondition.errors.txt index ef675fd5cb..d665c469be 100644 --- a/testdata/baselines/reference/submodule/compiler/typecheckIfCondition.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/typecheckIfCondition.errors.txt @@ -1,5 +1,5 @@ -typecheckIfCondition.ts(4,10): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -typecheckIfCondition.ts(4,26): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +typecheckIfCondition.ts(4,10): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +typecheckIfCondition.ts(4,26): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== typecheckIfCondition.ts (2 errors) ==== @@ -8,9 +8,9 @@ typecheckIfCondition.ts(4,26): error TS2580: Cannot find name 'module'. Do you n { if (!module.exports) module.exports = ""; ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. var x = null; // don't want to baseline output } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typecheckIfCondition.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/typecheckIfCondition.errors.txt.diff new file mode 100644 index 0000000000..8ad26190a2 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/typecheckIfCondition.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.typecheckIfCondition.errors.txt ++++ new.typecheckIfCondition.errors.txt +@@= skipped -0, +0 lines =@@ +-typecheckIfCondition.ts(4,10): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-typecheckIfCondition.ts(4,26): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++typecheckIfCondition.ts(4,10): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ++typecheckIfCondition.ts(4,26): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + + + ==== typecheckIfCondition.ts (2 errors) ==== +@@= skipped -7, +7 lines =@@ + { + if (!module.exports) module.exports = ""; + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + var x = null; // don't want to baseline output + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt b/testdata/baselines/reference/submodule/conformance/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt index 32d0fa85f9..e689bfc3b8 100644 --- a/testdata/baselines/reference/submodule/conformance/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt @@ -1,5 +1,5 @@ ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,1): error TS2304: Cannot find name 'declare'. -ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,16): error TS2819: Namespace name cannot be 'debugger'. ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,25): error TS1005: ';' expected. @@ -19,7 +19,7 @@ ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,25): error TS10 ~~~~~~~ !!! error TS2304: Cannot find name 'declare'. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~~~~~~ !!! error TS2819: Namespace name cannot be 'debugger'. ~ diff --git a/testdata/baselines/reference/submodule/conformance/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt.diff new file mode 100644 index 0000000000..89edae4110 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt ++++ new.ambientModuleDeclarationWithReservedIdentifierInDottedPath.errors.txt +@@= skipped -0, +0 lines =@@ + ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,1): error TS2304: Cannot find name 'declare'. +-ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,16): error TS2819: Namespace name cannot be 'debugger'. + ambientModuleDeclarationWithReservedIdentifierInDottedPath.ts(11,25): error TS1005: ';' expected. + +@@= skipped -18, +18 lines =@@ + ~~~~~~~ + !!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~~~~~~ + !!! error TS2819: Namespace name cannot be 'debugger'. + ~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/fixSignatureCaching.errors.txt b/testdata/baselines/reference/submodule/conformance/fixSignatureCaching.errors.txt index c6a1910440..5c3ceb0cf9 100644 --- a/testdata/baselines/reference/submodule/conformance/fixSignatureCaching.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/fixSignatureCaching.errors.txt @@ -50,9 +50,9 @@ fixSignatureCaching.ts(915,36): error TS2339: Property 'findMatches' does not ex fixSignatureCaching.ts(915,53): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. fixSignatureCaching.ts(955,42): error TS2339: Property 'mobileGrade' does not exist on type '{}'. fixSignatureCaching.ts(964,57): error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'. -fixSignatureCaching.ts(978,16): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -fixSignatureCaching.ts(978,42): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -fixSignatureCaching.ts(979,37): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +fixSignatureCaching.ts(978,16): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +fixSignatureCaching.ts(978,42): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +fixSignatureCaching.ts(979,37): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. fixSignatureCaching.ts(980,23): error TS2304: Cannot find name 'define'. fixSignatureCaching.ts(980,48): error TS2304: Cannot find name 'define'. fixSignatureCaching.ts(981,16): error TS2304: Cannot find name 'define'. @@ -1143,12 +1143,12 @@ fixSignatureCaching.ts(983,44): error TS2339: Property 'MobileDetect' does not e })((function (undefined) { if (typeof module !== 'undefined' && module.exports) { ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. return function (factory) { module.exports = factory(); }; ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. } else if (typeof define === 'function' && define.amd) { ~~~~~~ !!! error TS2304: Cannot find name 'define'. diff --git a/testdata/baselines/reference/submodule/conformance/fixSignatureCaching.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/fixSignatureCaching.errors.txt.diff new file mode 100644 index 0000000000..f8c745641d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/fixSignatureCaching.errors.txt.diff @@ -0,0 +1,31 @@ +--- old.fixSignatureCaching.errors.txt ++++ new.fixSignatureCaching.errors.txt +@@= skipped -49, +49 lines =@@ + fixSignatureCaching.ts(915,53): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. + fixSignatureCaching.ts(955,42): error TS2339: Property 'mobileGrade' does not exist on type '{}'. + fixSignatureCaching.ts(964,57): error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'. +-fixSignatureCaching.ts(978,16): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-fixSignatureCaching.ts(978,42): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-fixSignatureCaching.ts(979,37): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++fixSignatureCaching.ts(978,16): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ++fixSignatureCaching.ts(978,42): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ++fixSignatureCaching.ts(979,37): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + fixSignatureCaching.ts(980,23): error TS2304: Cannot find name 'define'. + fixSignatureCaching.ts(980,48): error TS2304: Cannot find name 'define'. + fixSignatureCaching.ts(981,16): error TS2304: Cannot find name 'define'. +@@= skipped -1093, +1093 lines =@@ + })((function (undefined) { + if (typeof module !== 'undefined' && module.exports) { + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + return function (factory) { module.exports = factory(); }; + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + } else if (typeof define === 'function' && define.amd) { + ~~~~~~ + !!! error TS2304: Cannot find name 'define'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDefinePropertyEmit.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDefinePropertyEmit.js index 112c86ab30..31be139b17 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDefinePropertyEmit.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDefinePropertyEmit.js @@ -176,8 +176,8 @@ export { _exported_10 as "j" }; //// [DtsFileErrors] -out/index.d.ts(36,15): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -out/index.d.ts(47,15): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +out/index.d.ts(36,15): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +out/index.d.ts(47,15): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== out/index.d.ts (2 errors) ==== @@ -218,7 +218,7 @@ out/index.d.ts(47,15): error TS2580: Cannot find name 'module'. Do you need to i }, b: { y: typeof module.exports.b; ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. }): void; declare const _exported_5: typeof g; export { _exported_5 as "g" }; @@ -231,7 +231,7 @@ out/index.d.ts(47,15): error TS2580: Cannot find name 'module'. Do you need to i }, b: { y: typeof module.exports.b; ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. }): void; declare const _exported_6: typeof hh; export { _exported_6 as "h" }; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDefinePropertyEmit.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDefinePropertyEmit.js.diff index b401ce7ed1..be808e7bb2 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDefinePropertyEmit.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDefinePropertyEmit.js.diff @@ -94,8 +94,8 @@ +//// [DtsFileErrors] + + -+out/index.d.ts(36,15): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+out/index.d.ts(47,15): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++out/index.d.ts(36,15): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ++out/index.d.ts(47,15): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + + +==== out/index.d.ts (2 errors) ==== @@ -160,7 +160,7 @@ + }, b: { + y: typeof module.exports.b; + ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + }): void; + declare const _exported_5: typeof g; + export { _exported_5 as "g" }; @@ -173,7 +173,7 @@ + }, b: { + y: typeof module.exports.b; + ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + }): void; + declare const _exported_6: typeof hh; + export { _exported_6 as "h" }; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt index 03ef528a8c..209b22f605 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt @@ -1,4 +1,4 @@ -index.js(9,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(9,11): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. index.js(9,17): error TS1005: '}' expected. @@ -13,7 +13,7 @@ index.js(9,17): error TS1005: '}' expected. * Target element * @type {module:A} ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1005: '}' expected. */ diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt.diff index 44818fe741..6408824fde 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsModuleReferenceHasEmit.errors.txt.diff @@ -2,7 +2,7 @@ +++ new.jsDeclarationsModuleReferenceHasEmit.errors.txt @@= skipped -0, +0 lines =@@ - -+index.js(9,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(9,11): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +index.js(9,17): error TS1005: '}' expected. + + @@ -17,7 +17,7 @@ + * Target element + * @type {module:A} + ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ +!!! error TS1005: '}' expected. + */ diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.js b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.js index 11cd4da35d..82d2ec5bd0 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.js +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.js @@ -30,3 +30,23 @@ declare const _default: { thing: import("fs").Something; }; export = _default; + + +//// [DtsFileErrors] + + +tests/cases/conformance/jsdoc/declarations/out/index.d.ts(2,19): error TS2307: Cannot find module 'fs' or its corresponding type declarations. + + +==== tests/cases/conformance/jsdoc/declarations/out/index.d.ts (1 errors) ==== + declare const _default: { + thing: import("fs").Something; + ~~~~ +!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. + }; + export = _default; + +==== node_modules/@types/node/index.d.ts (0 errors) ==== + declare module "fs" { + export class Something {} + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.js.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.js.diff index 4286a69c72..02cd70066a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.js.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.js.diff @@ -10,4 +10,24 @@ +declare const _default: { + thing: import("fs").Something; +}; -+export = _default; \ No newline at end of file ++export = _default; ++ ++ ++//// [DtsFileErrors] ++ ++ ++tests/cases/conformance/jsdoc/declarations/out/index.d.ts(2,19): error TS2307: Cannot find module 'fs' or its corresponding type declarations. ++ ++ ++==== tests/cases/conformance/jsdoc/declarations/out/index.d.ts (1 errors) ==== ++ declare const _default: { ++ thing: import("fs").Something; ++ ~~~~ ++!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. ++ }; ++ export = _default; ++ ++==== node_modules/@types/node/index.d.ts (0 errors) ==== ++ declare module "fs" { ++ export class Something {} ++ } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsxAndTypeAssertion.errors.txt b/testdata/baselines/reference/submodule/conformance/jsxAndTypeAssertion.errors.txt index 7346a4a136..2485c0a71a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsxAndTypeAssertion.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsxAndTypeAssertion.errors.txt @@ -1,5 +1,5 @@ jsxAndTypeAssertion.tsx(6,6): error TS17008: JSX element 'any' has no corresponding closing tag. -jsxAndTypeAssertion.tsx(6,13): error TS2582: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`. +jsxAndTypeAssertion.tsx(6,13): error TS2593: Cannot find name 'test'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig. jsxAndTypeAssertion.tsx(6,17): error TS1005: '}' expected. jsxAndTypeAssertion.tsx(6,31): error TS1381: Unexpected token. Did you mean `{'}'}` or `}`? jsxAndTypeAssertion.tsx(8,6): error TS17008: JSX element 'any' has no corresponding closing tag. @@ -33,7 +33,7 @@ jsxAndTypeAssertion.tsx(21,1): error TS1005: '({ workItem: this._workItem }, {}); ~ -!!! error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`. +!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserCommaInTypeMemberList2.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserCommaInTypeMemberList2.errors.txt.diff new file mode 100644 index 0000000000..353e1db9fe --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserCommaInTypeMemberList2.errors.txt.diff @@ -0,0 +1,13 @@ +--- old.parserCommaInTypeMemberList2.errors.txt ++++ new.parserCommaInTypeMemberList2.errors.txt +@@= skipped -0, +0 lines =@@ +-parserCommaInTypeMemberList2.ts(1,9): error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`. ++parserCommaInTypeMemberList2.ts(1,9): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + + + ==== parserCommaInTypeMemberList2.ts (1 errors) ==== + var s = $.extend< { workItem: any }, { workItem: any, width: string }>({ workItem: this._workItem }, {}); + ~ +-!!! error TS2581: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`. ++!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt index 31a75354a8..7c58edb870 100644 --- a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt @@ -1,8 +1,8 @@ parserharness.ts(21,21): error TS2749: 'Harness.Assert' refers to a value, but is being used as a type here. Did you mean 'typeof Harness.Assert'? parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. -parserharness.ts(43,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -parserharness.ts(44,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +parserharness.ts(43,19): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +parserharness.ts(44,14): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. parserharness.ts(341,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? parserharness.ts(347,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? parserharness.ts(351,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? @@ -157,10 +157,10 @@ parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean ' eval(typescriptServiceFile); } else if (typeof require === "function") { ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. var vm = require('vm'); ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. vm.runInThisContext(typescriptServiceFile, 'typescriptServices.js'); } else { throw new Error('Unknown context'); diff --git a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff index e36a9f9461..aa0cf32ec2 100644 --- a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff @@ -8,6 +8,13 @@ parserharness.ts(21,21): error TS2749: 'Harness.Assert' refers to a value, but is being used as a type here. Did you mean 'typeof Harness.Assert'? parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. +-parserharness.ts(43,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-parserharness.ts(44,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++parserharness.ts(43,19): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ++parserharness.ts(44,14): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + parserharness.ts(341,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? + parserharness.ts(347,13): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? + parserharness.ts(351,17): error TS2662: Cannot find name 'errorHandlerStack'. Did you mean the static member 'Runnable.errorHandlerStack'? @@= skipped -17, +13 lines =@@ parserharness.ts(724,29): error TS2304: Cannot find name 'ITextWriter'. parserharness.ts(754,53): error TS2552: Cannot find name 'TypeScript'. Did you mean 'TypeScriptLS'? @@ -169,7 +176,20 @@ declare var assert: Harness.Assert; ~~~~~~~~~~~~~~ -@@= skipped -790, +782 lines =@@ +@@= skipped -42, +34 lines =@@ + eval(typescriptServiceFile); + } else if (typeof require === "function") { + ~~~~~~~ +-!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + var vm = require('vm'); + ~~~~~~~ +-!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + vm.runInThisContext(typescriptServiceFile, 'typescriptServices.js'); + } else { + throw new Error('Unknown context'); +@@= skipped -748, +748 lines =@@ !!! error TS2503: Cannot find namespace 'TypeScript'. var compiler = c || new TypeScript.TypeScriptCompiler(stderr); ~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json index 17a9c55955..3a45cbbe16 100644 --- a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json +++ b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).trace.json @@ -109,13 +109,3 @@ File '/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution 'package.json' does not have a 'peerDependencies' field. Resolving real path for '/node_modules/@types/bar/index.d.ts', result '/node_modules/@types/bar/index.d.ts'. ======== Module name 'bar' was successfully resolved to '/node_modules/bar/index.mjs' with Package ID 'bar/index.mjs@1.0.0'. ======== -======== Resolving type reference directive 'bar', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. -Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. -File '/node_modules/@types/bar/package.json' exists according to earlier cached lookups. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' has 'types' field 'index.d.ts' that references '/node_modules/@types/bar/index.d.ts'. -File '/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/bar/index.d.ts', result '/node_modules/@types/bar/index.d.ts'. -======== Type reference directive 'bar' was successfully resolved to '/node_modules/@types/bar/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json index ce0c4345da..553b5f4bdf 100644 --- a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json +++ b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).trace.json @@ -98,13 +98,3 @@ File '/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution 'package.json' does not have a 'peerDependencies' field. Resolving real path for '/node_modules/@types/bar/index.d.ts', result '/node_modules/@types/bar/index.d.ts'. ======== Module name 'bar' was successfully resolved to '/node_modules/bar/index.mjs' with Package ID 'bar/index.mjs@1.0.0'. ======== -======== Resolving type reference directive 'bar', containing file '/.src/__inferred type names__.ts', root directory '/.src/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/.src/node_modules/@types, /node_modules/@types'. -Directory '/.src/node_modules/@types' does not exist, skipping all lookups in it. -File '/node_modules/@types/bar/package.json' exists according to earlier cached lookups. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' has 'types' field 'index.d.ts' that references '/node_modules/@types/bar/index.d.ts'. -File '/node_modules/@types/bar/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/bar/index.d.ts', result '/node_modules/@types/bar/index.d.ts'. -======== Type reference directive 'bar' was successfully resolved to '/node_modules/@types/bar/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/templateStringInModuleName.errors.txt b/testdata/baselines/reference/submodule/conformance/templateStringInModuleName.errors.txt index 8bc71e48c3..a691f3b30f 100644 --- a/testdata/baselines/reference/submodule/conformance/templateStringInModuleName.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/templateStringInModuleName.errors.txt @@ -1,8 +1,8 @@ templateStringInModuleName.ts(1,1): error TS2304: Cannot find name 'declare'. -templateStringInModuleName.ts(1,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +templateStringInModuleName.ts(1,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. templateStringInModuleName.ts(1,16): error TS1443: Module declaration names may only use ' or " quoted strings. templateStringInModuleName.ts(4,1): error TS2304: Cannot find name 'declare'. -templateStringInModuleName.ts(4,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +templateStringInModuleName.ts(4,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. templateStringInModuleName.ts(4,16): error TS1443: Module declaration names may only use ' or " quoted strings. @@ -11,7 +11,7 @@ templateStringInModuleName.ts(4,16): error TS1443: Module declaration names may ~~~~~~~ !!! error TS2304: Cannot find name 'declare'. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~~ !!! error TS1443: Module declaration names may only use ' or " quoted strings. } @@ -20,7 +20,7 @@ templateStringInModuleName.ts(4,16): error TS1443: Module declaration names may ~~~~~~~ !!! error TS2304: Cannot find name 'declare'. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~~~~~ !!! error TS1443: Module declaration names may only use ' or " quoted strings. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/templateStringInModuleName.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/templateStringInModuleName.errors.txt.diff new file mode 100644 index 0000000000..a5f52869d9 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/templateStringInModuleName.errors.txt.diff @@ -0,0 +1,31 @@ +--- old.templateStringInModuleName.errors.txt ++++ new.templateStringInModuleName.errors.txt +@@= skipped -0, +0 lines =@@ + templateStringInModuleName.ts(1,1): error TS2304: Cannot find name 'declare'. +-templateStringInModuleName.ts(1,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++templateStringInModuleName.ts(1,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + templateStringInModuleName.ts(1,16): error TS1443: Module declaration names may only use ' or " quoted strings. + templateStringInModuleName.ts(4,1): error TS2304: Cannot find name 'declare'. +-templateStringInModuleName.ts(4,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++templateStringInModuleName.ts(4,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + templateStringInModuleName.ts(4,16): error TS1443: Module declaration names may only use ' or " quoted strings. + + +@@= skipped -10, +10 lines =@@ + ~~~~~~~ + !!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~~ + !!! error TS1443: Module declaration names may only use ' or " quoted strings. + } +@@= skipped -9, +9 lines =@@ + ~~~~~~~ + !!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~~~~~ + !!! error TS1443: Module declaration names may only use ' or " quoted strings. + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/templateStringInModuleNameES6.errors.txt b/testdata/baselines/reference/submodule/conformance/templateStringInModuleNameES6.errors.txt index 889daa0f75..180a8d7e65 100644 --- a/testdata/baselines/reference/submodule/conformance/templateStringInModuleNameES6.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/templateStringInModuleNameES6.errors.txt @@ -1,8 +1,8 @@ templateStringInModuleNameES6.ts(1,1): error TS2304: Cannot find name 'declare'. -templateStringInModuleNameES6.ts(1,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +templateStringInModuleNameES6.ts(1,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. templateStringInModuleNameES6.ts(1,16): error TS1443: Module declaration names may only use ' or " quoted strings. templateStringInModuleNameES6.ts(4,1): error TS2304: Cannot find name 'declare'. -templateStringInModuleNameES6.ts(4,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +templateStringInModuleNameES6.ts(4,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. templateStringInModuleNameES6.ts(4,16): error TS1443: Module declaration names may only use ' or " quoted strings. @@ -11,7 +11,7 @@ templateStringInModuleNameES6.ts(4,16): error TS1443: Module declaration names m ~~~~~~~ !!! error TS2304: Cannot find name 'declare'. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~~ !!! error TS1443: Module declaration names may only use ' or " quoted strings. } @@ -20,7 +20,7 @@ templateStringInModuleNameES6.ts(4,16): error TS1443: Module declaration names m ~~~~~~~ !!! error TS2304: Cannot find name 'declare'. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~~~~~~~ !!! error TS1443: Module declaration names may only use ' or " quoted strings. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/templateStringInModuleNameES6.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/templateStringInModuleNameES6.errors.txt.diff new file mode 100644 index 0000000000..adb6a42e17 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/templateStringInModuleNameES6.errors.txt.diff @@ -0,0 +1,31 @@ +--- old.templateStringInModuleNameES6.errors.txt ++++ new.templateStringInModuleNameES6.errors.txt +@@= skipped -0, +0 lines =@@ + templateStringInModuleNameES6.ts(1,1): error TS2304: Cannot find name 'declare'. +-templateStringInModuleNameES6.ts(1,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++templateStringInModuleNameES6.ts(1,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + templateStringInModuleNameES6.ts(1,16): error TS1443: Module declaration names may only use ' or " quoted strings. + templateStringInModuleNameES6.ts(4,1): error TS2304: Cannot find name 'declare'. +-templateStringInModuleNameES6.ts(4,9): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++templateStringInModuleNameES6.ts(4,9): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + templateStringInModuleNameES6.ts(4,16): error TS1443: Module declaration names may only use ' or " quoted strings. + + +@@= skipped -10, +10 lines =@@ + ~~~~~~~ + !!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~~ + !!! error TS1443: Module declaration names may only use ' or " quoted strings. + } +@@= skipped -9, +9 lines =@@ + ~~~~~~~ + !!! error TS2304: Cannot find name 'declare'. + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~~~~~~~ + !!! error TS1443: Module declaration names may only use ' or " quoted strings. + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt index db8ede3fef..b10b2af7b6 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt @@ -1,5 +1,5 @@ mod.js(1,14): error TS2304: Cannot find name 'exports'. -mod.js(1,24): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod.js(1,24): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. use.js(1,22): error TS2306: File 'mod.js' is not a module. @@ -17,7 +17,7 @@ use.js(1,22): error TS2306: File 'mod.js' is not a module. ~~~~~~~ !!! error TS2304: Cannot find name 'exports'. ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. if (!!false) { util.existy = function () { } } diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt.diff index 4c08740d66..668b62c93b 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt.diff @@ -3,7 +3,7 @@ @@= skipped -0, +0 lines =@@ - +mod.js(1,14): error TS2304: Cannot find name 'exports'. -+mod.js(1,24): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod.js(1,24): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +use.js(1,22): error TS2306: File 'mod.js' is not a module. + + @@ -21,7 +21,7 @@ + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. + ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + if (!!false) { + util.existy = function () { } + } diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup1.trace.json b/testdata/baselines/reference/submodule/conformance/typingsLookup1.trace.json index 4960bf5610..42432a13da 100644 --- a/testdata/baselines/reference/submodule/conformance/typingsLookup1.trace.json +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup1.trace.json @@ -4,9 +4,3 @@ File '/node_modules/@types/jquery/package.json' does not exist. File '/node_modules/@types/jquery/index.d.ts' exists - use it as a name resolution result. Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'. ======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ======== -======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== -Resolving with primary search path '/node_modules/@types'. -File '/node_modules/@types/jquery/package.json' does not exist according to earlier cached lookups. -File '/node_modules/@types/jquery/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'. -======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup3.errors.txt b/testdata/baselines/reference/submodule/conformance/typingsLookup3.errors.txt index 5073cb5493..11b8a93f7c 100644 --- a/testdata/baselines/reference/submodule/conformance/typingsLookup3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup3.errors.txt @@ -1,14 +1,17 @@ /a.ts(1,23): error TS2688: Cannot find type definition file for 'JqUeRy'. +/a.ts(2,1): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ==== /tsconfig.json (0 errors) ==== { "files": "a.ts" } -==== /a.ts (1 errors) ==== +==== /a.ts (2 errors) ==== /// ~~~~~~ !!! error TS2688: Cannot find type definition file for 'JqUeRy'. $.x; + ~ +!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. ==== /node_modules/@types/jquery/index.d.ts (0 errors) ==== declare var $: { x: any }; diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup3.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/typingsLookup3.errors.txt.diff new file mode 100644 index 0000000000..845f9698eb --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup3.errors.txt.diff @@ -0,0 +1,21 @@ +--- old.typingsLookup3.errors.txt ++++ new.typingsLookup3.errors.txt +@@= skipped -0, +0 lines =@@ + /a.ts(1,23): error TS2688: Cannot find type definition file for 'JqUeRy'. ++/a.ts(2,1): error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + + + ==== /tsconfig.json (0 errors) ==== + { "files": "a.ts" } + +-==== /a.ts (1 errors) ==== ++==== /a.ts (2 errors) ==== + /// + ~~~~~~ + !!! error TS2688: Cannot find type definition file for 'JqUeRy'. + $.x; ++ ~ ++!!! error TS2592: Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig. + + ==== /node_modules/@types/jquery/index.d.ts (0 errors) ==== + declare var $: { x: any }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup3.symbols b/testdata/baselines/reference/submodule/conformance/typingsLookup3.symbols index 743c42a1b8..e677900ded 100644 --- a/testdata/baselines/reference/submodule/conformance/typingsLookup3.symbols +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup3.symbols @@ -1,14 +1,7 @@ //// [tests/cases/conformance/typings/typingsLookup3.ts] //// === /a.ts === + /// $.x; ->$.x : Symbol(x, Decl(index.d.ts, 0, 16)) ->$ : Symbol($, Decl(index.d.ts, 0, 11)) ->x : Symbol(x, Decl(index.d.ts, 0, 16)) - -=== /node_modules/@types/jquery/index.d.ts === -declare var $: { x: any }; ->$ : Symbol($, Decl(index.d.ts, 0, 11)) ->x : Symbol(x, Decl(index.d.ts, 0, 16)) diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup3.symbols.diff b/testdata/baselines/reference/submodule/conformance/typingsLookup3.symbols.diff new file mode 100644 index 0000000000..9372e57b7d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup3.symbols.diff @@ -0,0 +1,17 @@ +--- old.typingsLookup3.symbols ++++ new.typingsLookup3.symbols +@@= skipped -0, +0 lines =@@ + //// [tests/cases/conformance/typings/typingsLookup3.ts] //// + + === /a.ts === ++ + /// + $.x; +->$.x : Symbol(x, Decl(index.d.ts, 0, 16)) +->$ : Symbol($, Decl(index.d.ts, 0, 11)) +->x : Symbol(x, Decl(index.d.ts, 0, 16)) +- +-=== /node_modules/@types/jquery/index.d.ts === +-declare var $: { x: any }; +->$ : Symbol($, Decl(index.d.ts, 0, 11)) +->x : Symbol(x, Decl(index.d.ts, 0, 16)) diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup3.trace.json b/testdata/baselines/reference/submodule/conformance/typingsLookup3.trace.json index 9957e4d2ce..1a6e792139 100644 --- a/testdata/baselines/reference/submodule/conformance/typingsLookup3.trace.json +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup3.trace.json @@ -5,9 +5,3 @@ Searching all ancestor node_modules directories for preferred extensions: Declar File '/node_modules/JqUeRy.d.ts' does not exist. File '/node_modules/@types/JqUeRy.d.ts' does not exist. ======== Type reference directive 'JqUeRy' was not resolved. ======== -======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== -Resolving with primary search path '/node_modules/@types'. -File '/node_modules/@types/jquery/package.json' does not exist. -File '/node_modules/@types/jquery/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/jquery/index.d.ts', result '/node_modules/@types/jquery/index.d.ts'. -======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup3.types b/testdata/baselines/reference/submodule/conformance/typingsLookup3.types index 5a8264a2f1..7a9f05c032 100644 --- a/testdata/baselines/reference/submodule/conformance/typingsLookup3.types +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup3.types @@ -4,11 +4,6 @@ /// $.x; >$.x : any ->$ : { x: any; } ->x : any - -=== /node_modules/@types/jquery/index.d.ts === -declare var $: { x: any }; ->$ : { x: any; } +>$ : any >x : any diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup3.types.diff b/testdata/baselines/reference/submodule/conformance/typingsLookup3.types.diff new file mode 100644 index 0000000000..6e317240e2 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup3.types.diff @@ -0,0 +1,14 @@ +--- old.typingsLookup3.types ++++ new.typingsLookup3.types +@@= skipped -3, +3 lines =@@ + /// + $.x; + >$.x : any +->$ : { x: any; } +->x : any +- +-=== /node_modules/@types/jquery/index.d.ts === +-declare var $: { x: any }; +->$ : { x: any; } ++>$ : any + >x : any diff --git a/testdata/baselines/reference/submodule/conformance/typingsLookup4.trace.json b/testdata/baselines/reference/submodule/conformance/typingsLookup4.trace.json index 908679d09e..d3e6759471 100644 --- a/testdata/baselines/reference/submodule/conformance/typingsLookup4.trace.json +++ b/testdata/baselines/reference/submodule/conformance/typingsLookup4.trace.json @@ -71,44 +71,3 @@ File '/node_modules/@types/mquery/mquery/index.ts' does not exist. File '/node_modules/@types/mquery/mquery/index.tsx' exists - use it as a name resolution result. Resolving real path for '/node_modules/@types/mquery/mquery/index.tsx', result '/node_modules/@types/mquery/mquery/index.tsx'. ======== Module name 'mquery' was successfully resolved to '/node_modules/@types/mquery/mquery/index.tsx'. ======== -======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== -Resolving with primary search path '/node_modules/@types'. -File '/node_modules/@types/jquery/package.json' exists according to earlier cached lookups. -'package.json' does not have a 'typesVersions' field. -'package.json' has 'typings' field 'jquery.d.ts' that references '/node_modules/@types/jquery/jquery.d.ts'. -File '/node_modules/@types/jquery/jquery.d.ts' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/jquery/jquery.d.ts', result '/node_modules/@types/jquery/jquery.d.ts'. -======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/jquery.d.ts', primary: true. ======== -======== Resolving type reference directive 'kquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== -Resolving with primary search path '/node_modules/@types'. -File '/node_modules/@types/kquery/package.json' exists according to earlier cached lookups. -'package.json' does not have a 'typesVersions' field. -'package.json' has 'typings' field 'kquery' that references '/node_modules/@types/kquery/kquery'. -Loading module as file / folder, candidate module location '/node_modules/@types/kquery/kquery', target file types: TypeScript, Declaration. -File '/node_modules/@types/kquery/kquery.ts' does not exist according to earlier cached lookups. -File '/node_modules/@types/kquery/kquery.tsx' does not exist according to earlier cached lookups. -File '/node_modules/@types/kquery/kquery.d.ts' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/kquery/kquery.d.ts', result '/node_modules/@types/kquery/kquery.d.ts'. -======== Type reference directive 'kquery' was successfully resolved to '/node_modules/@types/kquery/kquery.d.ts', primary: true. ======== -======== Resolving type reference directive 'lquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== -Resolving with primary search path '/node_modules/@types'. -File '/node_modules/@types/lquery/package.json' exists according to earlier cached lookups. -'package.json' does not have a 'typesVersions' field. -'package.json' has 'typings' field 'lquery' that references '/node_modules/@types/lquery/lquery'. -Loading module as file / folder, candidate module location '/node_modules/@types/lquery/lquery', target file types: TypeScript, Declaration. -File '/node_modules/@types/lquery/lquery.ts' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/lquery/lquery.ts', result '/node_modules/@types/lquery/lquery.ts'. -======== Type reference directive 'lquery' was successfully resolved to '/node_modules/@types/lquery/lquery.ts', primary: true. ======== -======== Resolving type reference directive 'mquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ======== -Resolving with primary search path '/node_modules/@types'. -File '/node_modules/@types/mquery/package.json' exists according to earlier cached lookups. -'package.json' does not have a 'typesVersions' field. -'package.json' has 'typings' field 'mquery' that references '/node_modules/@types/mquery/mquery'. -Loading module as file / folder, candidate module location '/node_modules/@types/mquery/mquery', target file types: TypeScript, Declaration. -File '/node_modules/@types/mquery/mquery.ts' does not exist according to earlier cached lookups. -File '/node_modules/@types/mquery/mquery.tsx' does not exist according to earlier cached lookups. -File '/node_modules/@types/mquery/mquery.d.ts' does not exist according to earlier cached lookups. -File '/node_modules/@types/mquery/mquery/index.ts' does not exist according to earlier cached lookups. -File '/node_modules/@types/mquery/mquery/index.tsx' exists - use it as a name resolution result. -Resolving real path for '/node_modules/@types/mquery/mquery/index.tsx', result '/node_modules/@types/mquery/mquery/index.tsx'. -======== Type reference directive 'mquery' was successfully resolved to '/node_modules/@types/mquery/mquery/index.tsx', primary: true. ======== diff --git a/testdata/baselines/reference/submodule/conformance/typingsSuggestion2.errors.txt b/testdata/baselines/reference/submodule/conformance/typingsSuggestion2.errors.txt index c166630f3d..0e77b57554 100644 --- a/testdata/baselines/reference/submodule/conformance/typingsSuggestion2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typingsSuggestion2.errors.txt @@ -1,4 +1,4 @@ -a.ts(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +a.ts(1,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== tsconfig.json (0 errors) ==== @@ -7,5 +7,5 @@ a.ts(1,1): error TS2580: Cannot find name 'module'. Do you need to install type ==== a.ts (1 errors) ==== module.exports = 1; ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typingsSuggestion2.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/typingsSuggestion2.errors.txt.diff new file mode 100644 index 0000000000..c0cca8508d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typingsSuggestion2.errors.txt.diff @@ -0,0 +1,15 @@ +--- old.typingsSuggestion2.errors.txt ++++ new.typingsSuggestion2.errors.txt +@@= skipped -0, +0 lines =@@ +-a.ts(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++a.ts(1,1): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + + + ==== tsconfig.json (0 errors) ==== +@@= skipped -6, +6 lines =@@ + ==== a.ts (1 errors) ==== + module.exports = 1; + ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typingsSuggestionBun2.errors.txt b/testdata/baselines/reference/submodule/conformance/typingsSuggestionBun2.errors.txt index 309dc7e05b..ff8eedab8a 100644 --- a/testdata/baselines/reference/submodule/conformance/typingsSuggestionBun2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typingsSuggestionBun2.errors.txt @@ -1,4 +1,4 @@ -a.ts(1,14): error TS2867: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`. +a.ts(1,14): error TS2868: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig. ==== tsconfig.json (0 errors) ==== @@ -7,5 +7,5 @@ a.ts(1,14): error TS2867: Cannot find name 'Bun'. Do you need to install type de ==== a.ts (1 errors) ==== const file = Bun.file("/a.ts"); ~~~ -!!! error TS2867: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`. +!!! error TS2868: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typingsSuggestionBun2.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/typingsSuggestionBun2.errors.txt.diff new file mode 100644 index 0000000000..76915d6482 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typingsSuggestionBun2.errors.txt.diff @@ -0,0 +1,15 @@ +--- old.typingsSuggestionBun2.errors.txt ++++ new.typingsSuggestionBun2.errors.txt +@@= skipped -0, +0 lines =@@ +-a.ts(1,14): error TS2867: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`. ++a.ts(1,14): error TS2868: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig. + + + ==== tsconfig.json (0 errors) ==== +@@= skipped -6, +6 lines =@@ + ==== a.ts (1 errors) ==== + const file = Bun.file("/a.ts"); + ~~~ +-!!! error TS2867: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`. ++!!! error TS2868: Cannot find name 'Bun'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc b/testdata/baselines/reference/submodule/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc index e6b3049cf9..63169a81fa 100644 --- a/testdata/baselines/reference/submodule/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc +++ b/testdata/baselines/reference/submodule/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc @@ -6,10 +6,6 @@ // === findAllReferences === -// === /node_modules/@types/three/index.d.ts === -// export * from "[|./three-core|]"; -// export as namespace THREE; - // === /typings/global.d.ts === // import * as _THREE from '/*FIND ALL REFS*/[|three|]'; // declare global { diff --git a/testdata/baselines/reference/submodule/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc.diff b/testdata/baselines/reference/submodule/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc.diff deleted file mode 100644 index 40f42e2500..0000000000 --- a/testdata/baselines/reference/submodule/fourslash/findAllReferences/findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc -+++ new.findAllReferencesUmdModuleAsGlobalConst.baseline.jsonc -@@= skipped -5, +5 lines =@@ - - - // === findAllReferences === -+// === /node_modules/@types/three/index.d.ts === -+// export * from "[|./three-core|]"; -+// export as namespace THREE; -+ - // === /typings/global.d.ts === - // import * as _THREE from '/*FIND ALL REFS*/[|three|]'; - // declare global { \ No newline at end of file diff --git a/testdata/baselines/reference/tsbuild/libraryResolution/with-config-with-libReplacement.js b/testdata/baselines/reference/tsbuild/libraryResolution/with-config-with-libReplacement.js index d29afda959..9bd12d8012 100644 --- a/testdata/baselines/reference/tsbuild/libraryResolution/with-config-with-libReplacement.js +++ b/testdata/baselines/reference/tsbuild/libraryResolution/with-config-with-libReplacement.js @@ -138,13 +138,6 @@ Output:: [HH:MM:SS AM] Building project 'project1/tsconfig.json'... -======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== -Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. -File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. -======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== ======== Resolving module '@typescript/lib-dom' from '/home/src/workspace/projects/project1/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ======== Module resolution kind is not specified, using 'Bundler'. Resolving in CJS mode with conditions 'require', 'types'. @@ -258,7 +251,6 @@ project1/utils.d.ts Matched by default include pattern '**/*' project1/typeroot1/sometype/index.d.ts Matched by default include pattern '**/*' - Entry point for implicit type library 'sometype' [HH:MM:SS AM] Project 'project2/tsconfig.json' is out of date because output file 'project2/tsconfig.tsbuildinfo' does not exist [HH:MM:SS AM] Building project 'project2/tsconfig.json'... diff --git a/testdata/baselines/reference/tsbuild/libraryResolution/with-config.js b/testdata/baselines/reference/tsbuild/libraryResolution/with-config.js index 32a0ecfdaf..ca3bd52ca4 100644 --- a/testdata/baselines/reference/tsbuild/libraryResolution/with-config.js +++ b/testdata/baselines/reference/tsbuild/libraryResolution/with-config.js @@ -86,13 +86,6 @@ Output:: [HH:MM:SS AM] Building project 'project1/tsconfig.json'... -======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== -Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. -File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. -======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.es5.d.ts Library referenced via 'es5' from file 'project1/file2.ts' Library 'lib.es5.d.ts' specified in compilerOptions @@ -114,7 +107,6 @@ project1/utils.d.ts Matched by default include pattern '**/*' project1/typeroot1/sometype/index.d.ts Matched by default include pattern '**/*' - Entry point for implicit type library 'sometype' [HH:MM:SS AM] Project 'project2/tsconfig.json' is out of date because output file 'project2/tsconfig.tsbuildinfo' does not exist [HH:MM:SS AM] Building project 'project2/tsconfig.json'... diff --git a/testdata/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js b/testdata/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js index 9e027a692d..a1c01757b6 100644 --- a/testdata/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js +++ b/testdata/baselines/reference/tsbuild/moduleResolution/impliedNodeFormat-differs-between-projects-for-shared-file.js @@ -43,22 +43,10 @@ Output:: [HH:MM:SS AM] Building project 'a/tsconfig.json'... -======== Resolving type reference directive 'pg', containing file '/home/src/workspaces/project/a/__inferred type names__.ts', root directory '/home/src/workspaces/project/a/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/home/src/workspaces/project/a/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -Directory '/home/src/workspaces/project/a/node_modules/@types' does not exist, skipping all lookups in it. -Found 'package.json' at '/home/src/workspaces/project/node_modules/@types/pg/package.json'. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' has 'types' field 'index.d.ts' that references '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. -File '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. -======== Type reference directive 'pg' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' a/src/index.ts Matched by default include pattern '**/*' -node_modules/@types/pg/index.d.ts - Entry point for implicit type library 'pg' [HH:MM:SS AM] Project 'b/tsconfig.json' is out of date because output file 'b/tsconfig.tsbuildinfo' does not exist [HH:MM:SS AM] Building project 'b/tsconfig.json'... @@ -81,21 +69,10 @@ Found 'package.json' at '/home/src/workspaces/project/node_modules/@types/pg/pac File '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts' exists - use it as a name resolution result. Resolving real path for '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. ======== Module name 'pg' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. ======== -======== Resolving type reference directive 'pg', containing file '/home/src/workspaces/project/b/__inferred type names__.ts', root directory '/home/src/workspaces/project/b/node_modules/@types,/home/src/workspaces/project/node_modules/@types,/home/src/workspaces/node_modules/@types,/home/src/node_modules/@types,/home/node_modules/@types,/node_modules/@types'. ======== -Resolving with primary search path '/home/src/workspaces/project/b/node_modules/@types, /home/src/workspaces/project/node_modules/@types, /home/src/workspaces/node_modules/@types, /home/src/node_modules/@types, /home/node_modules/@types, /node_modules/@types'. -Directory '/home/src/workspaces/project/b/node_modules/@types' does not exist, skipping all lookups in it. -Found 'package.json' at '/home/src/workspaces/project/node_modules/@types/pg/package.json'. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' has 'types' field 'index.d.ts' that references '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. -File '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', result '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts'. -======== Type reference directive 'pg' was successfully resolved to '/home/src/workspaces/project/node_modules/@types/pg/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.es2022.full.d.ts Default library for target 'ES2022' node_modules/@types/pg/index.d.ts Imported via "pg" from file 'b/src/index.ts' - Entry point for implicit type library 'pg' File is CommonJS module because 'node_modules/@types/pg/package.json' does not have field "type" b/src/index.ts Matched by default include pattern '**/*' @@ -188,7 +165,6 @@ a/tsconfig.json:: SemanticDiagnostics:: *refresh* /home/src/tslibs/TS/Lib/lib.d.ts *refresh* /home/src/workspaces/project/a/src/index.ts -*refresh* /home/src/workspaces/project/node_modules/@types/pg/index.d.ts Signatures:: b/tsconfig.json:: diff --git a/testdata/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js b/testdata/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js index 814527f39e..be49780772 100644 --- a/testdata/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js +++ b/testdata/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js @@ -27,7 +27,7 @@ declare type TheNum = "type1"; declare type TheNum2 = "type2"; tsgo -b packages/pkg1.tsconfig.json packages/pkg2.tsconfig.json --verbose --traceResolution -ExitStatus:: Success +ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: [HH:MM:SS AM] Projects in this build: * packages/pkg1.tsconfig.json @@ -37,24 +37,27 @@ Output:: [HH:MM:SS AM] Building project 'packages/pkg1.tsconfig.json'... -======== Resolving type reference directive 'sometype', containing file '/home/src/workspaces/project/packages/__inferred type names__.ts', root directory '/home/src/workspaces/project/packages/typeroot1'. ======== -Resolving with primary search path '/home/src/workspaces/project/packages/typeroot1'. -File '/home/src/workspaces/project/packages/typeroot1/sometype.d.ts' does not exist. -File '/home/src/workspaces/project/packages/typeroot1/sometype/package.json' does not exist. -File '/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts', result '/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts'. -======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts', primary: true. ======== +packages/pkg1_index.ts:1:22 - error TS2304: Cannot find name 'TheNum'. + +1 export const theNum: TheNum = "type1"; +   ~~~~~~ + [HH:MM:SS AM] Project 'packages/pkg2.tsconfig.json' is out of date because output file 'packages/pkg2.tsconfig.tsbuildinfo' does not exist [HH:MM:SS AM] Building project 'packages/pkg2.tsconfig.json'... -======== Resolving type reference directive 'sometype', containing file '/home/src/workspaces/project/packages/__inferred type names__.ts', root directory '/home/src/workspaces/project/packages/typeroot2'. ======== -Resolving with primary search path '/home/src/workspaces/project/packages/typeroot2'. -File '/home/src/workspaces/project/packages/typeroot2/sometype.d.ts' does not exist. -File '/home/src/workspaces/project/packages/typeroot2/sometype/package.json' does not exist. -File '/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts', result '/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts'. -======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts', primary: true. ======== +packages/pkg2_index.ts:1:22 - error TS2304: Cannot find name 'TheNum2'. + +1 export const theNum: TheNum2 = "type2"; +   ~~~~~~~ + + +Found 2 errors in 2 files. + +Errors Files + 1 packages/pkg1_index.ts:1 + 1 packages/pkg2_index.ts:1 + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -79,7 +82,7 @@ interface Symbol { } declare const console: { log(msg: any): void; }; //// [/home/src/workspaces/project/packages/pkg1.tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./pkg1_index.ts","./typeroot1/sometype/index.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f4662ef3bd793790375f811e7f7d599f-export const theNum: TheNum = \"type1\";","signature":"dea6d3f907d93004db9004d6cea5698d-export declare const theNum: TheNum;\n","impliedNodeFormat":1},{"version":"74a6031362359bba204461bbf64bca2c-declare type TheNum = \"type1\";","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./pkg1_index.d.ts"} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./pkg1_index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"f4662ef3bd793790375f811e7f7d599f-export const theNum: TheNum = \"type1\";","signature":"dea6d3f907d93004db9004d6cea5698d-export declare const theNum: TheNum;\n","impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[[2,[{"pos":21,"end":27,"code":2304,"category":1,"messageKey":"Cannot_find_name_0_2304","messageArgs":["TheNum"]}]]],"latestChangedDtsFile":"./pkg1_index.d.ts"} //// [/home/src/workspaces/project/packages/pkg1.tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -93,8 +96,7 @@ declare const console: { log(msg: any): void; }; ], "fileNames": [ "lib.d.ts", - "./pkg1_index.ts", - "./typeroot1/sometype/index.d.ts" + "./pkg1_index.ts" ], "fileInfos": [ { @@ -119,25 +121,30 @@ declare const console: { log(msg: any): void; }; "signature": "dea6d3f907d93004db9004d6cea5698d-export declare const theNum: TheNum;\n", "impliedNodeFormat": 1 } - }, - { - "fileName": "./typeroot1/sometype/index.d.ts", - "version": "74a6031362359bba204461bbf64bca2c-declare type TheNum = \"type1\";", - "signature": "74a6031362359bba204461bbf64bca2c-declare type TheNum = \"type1\";", - "affectsGlobalScope": true, - "impliedNodeFormat": "CommonJS", - "original": { - "version": "74a6031362359bba204461bbf64bca2c-declare type TheNum = \"type1\";", - "affectsGlobalScope": true, - "impliedNodeFormat": 1 - } } ], "options": { "composite": true }, + "semanticDiagnosticsPerFile": [ + [ + "./pkg1_index.ts", + [ + { + "pos": 21, + "end": 27, + "code": 2304, + "category": 1, + "messageKey": "Cannot_find_name_0_2304", + "messageArgs": [ + "TheNum" + ] + } + ] + ] + ], "latestChangedDtsFile": "./pkg1_index.d.ts", - "size": 1295 + "size": 1279 } //// [/home/src/workspaces/project/packages/pkg1_index.d.ts] *new* export declare const theNum: TheNum; @@ -149,7 +156,7 @@ exports.theNum = void 0; exports.theNum = "type1"; //// [/home/src/workspaces/project/packages/pkg2.tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./pkg2_index.ts","./typeroot2/sometype/index.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"5520638613ac947a47797c35d3ad9c4b-export const theNum: TheNum2 = \"type2\";","signature":"becc5ed6bddc5e1124b92e180d59b5e3-export declare const theNum: TheNum2;\n","impliedNodeFormat":1},{"version":"660a36a739fc0e581ff911c4d5604b0e-declare type TheNum2 = \"type2\";","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./pkg2_index.d.ts"} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./pkg2_index.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"5520638613ac947a47797c35d3ad9c4b-export const theNum: TheNum2 = \"type2\";","signature":"becc5ed6bddc5e1124b92e180d59b5e3-export declare const theNum: TheNum2;\n","impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[[2,[{"pos":21,"end":28,"code":2304,"category":1,"messageKey":"Cannot_find_name_0_2304","messageArgs":["TheNum2"]}]]],"latestChangedDtsFile":"./pkg2_index.d.ts"} //// [/home/src/workspaces/project/packages/pkg2.tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -163,8 +170,7 @@ exports.theNum = "type1"; ], "fileNames": [ "lib.d.ts", - "./pkg2_index.ts", - "./typeroot2/sometype/index.d.ts" + "./pkg2_index.ts" ], "fileInfos": [ { @@ -189,25 +195,30 @@ exports.theNum = "type1"; "signature": "becc5ed6bddc5e1124b92e180d59b5e3-export declare const theNum: TheNum2;\n", "impliedNodeFormat": 1 } - }, - { - "fileName": "./typeroot2/sometype/index.d.ts", - "version": "660a36a739fc0e581ff911c4d5604b0e-declare type TheNum2 = \"type2\";", - "signature": "660a36a739fc0e581ff911c4d5604b0e-declare type TheNum2 = \"type2\";", - "affectsGlobalScope": true, - "impliedNodeFormat": "CommonJS", - "original": { - "version": "660a36a739fc0e581ff911c4d5604b0e-declare type TheNum2 = \"type2\";", - "affectsGlobalScope": true, - "impliedNodeFormat": 1 - } } ], "options": { "composite": true }, + "semanticDiagnosticsPerFile": [ + [ + "./pkg2_index.ts", + [ + { + "pos": 21, + "end": 28, + "code": 2304, + "category": 1, + "messageKey": "Cannot_find_name_0_2304", + "messageArgs": [ + "TheNum2" + ] + } + ] + ] + ], "latestChangedDtsFile": "./pkg2_index.d.ts", - "size": 1298 + "size": 1282 } //// [/home/src/workspaces/project/packages/pkg2_index.d.ts] *new* export declare const theNum: TheNum2; @@ -223,7 +234,6 @@ packages/pkg1.tsconfig.json:: SemanticDiagnostics:: *refresh* /home/src/tslibs/TS/Lib/lib.d.ts *refresh* /home/src/workspaces/project/packages/pkg1_index.ts -*refresh* /home/src/workspaces/project/packages/typeroot1/sometype/index.d.ts Signatures:: (stored at emit) /home/src/workspaces/project/packages/pkg1_index.ts @@ -231,6 +241,5 @@ packages/pkg2.tsconfig.json:: SemanticDiagnostics:: *refresh* /home/src/tslibs/TS/Lib/lib.d.ts *refresh* /home/src/workspaces/project/packages/pkg2_index.ts -*refresh* /home/src/workspaces/project/packages/typeroot2/sometype/index.d.ts Signatures:: (stored at emit) /home/src/workspaces/project/packages/pkg2_index.ts diff --git a/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js index 1bc6e8b2bf..425692a9d2 100644 --- a/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js +++ b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config-with-libReplacement.js @@ -140,13 +140,6 @@ Output:: [HH:MM:SS AM] Building project 'project1/tsconfig.json'... -======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== -Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. -File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. -======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== ======== Resolving module '@typescript/lib-dom' from '/home/src/workspace/projects/project1/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ======== Module resolution kind is not specified, using 'Bundler'. Resolving in CJS mode with conditions 'require', 'types'. @@ -260,7 +253,6 @@ project1/utils.d.ts Matched by default include pattern '**/*' project1/typeroot1/sometype/index.d.ts Matched by default include pattern '**/*' - Entry point for implicit type library 'sometype' [HH:MM:SS AM] Project 'project2/tsconfig.json' is out of date because output file 'project2/tsconfig.tsbuildinfo' does not exist [HH:MM:SS AM] Building project 'project2/tsconfig.json'... diff --git a/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js index a3fec6415c..549e7e58ae 100644 --- a/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js +++ b/testdata/baselines/reference/tsbuildWatch/libraryResolution/with-config.js @@ -88,13 +88,6 @@ Output:: [HH:MM:SS AM] Building project 'project1/tsconfig.json'... -======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== -Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. -File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. -======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.es5.d.ts Library referenced via 'es5' from file 'project1/file2.ts' Library 'lib.es5.d.ts' specified in compilerOptions @@ -116,7 +109,6 @@ project1/utils.d.ts Matched by default include pattern '**/*' project1/typeroot1/sometype/index.d.ts Matched by default include pattern '**/*' - Entry point for implicit type library 'sometype' [HH:MM:SS AM] Project 'project2/tsconfig.json' is out of date because output file 'project2/tsconfig.tsbuildinfo' does not exist [HH:MM:SS AM] Building project 'project2/tsconfig.json'... diff --git a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js index 2935b804de..6cc5a27c38 100644 --- a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js +++ b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash-under---strict.js @@ -30,13 +30,23 @@ export const App = () =>
; tsgo --strict ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +src/index.tsx:1:26 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + +1 export const App = () =>
; +   ~~~~~~~~~~~~~~~~~~ + src/index.tsx:1:26 - error TS7016: Could not find a declaration file for module 'react/jsx-runtime'. '/home/src/workspaces/project/node_modules/react/jsx-runtime.js' implicitly has an 'any' type. 1 export const App = () =>
;    ~~~~~~~~~~~~~~~~~~~~~~~~ +src/index.tsx:1:44 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + +1 export const App = () =>
; +   ~~~~~~ + -Found 1 error in src/index.tsx:1 +Found 3 errors in the same file, starting at: src/index.tsx:1 //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// @@ -70,7 +80,7 @@ const App = () => jsx_runtime_1.jsx("div", { propA: true }); exports.App = App; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/index.tsx","./node_modules/@types/react/index.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;",{"version":"a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":4,"jsxImportSource":"react","module":1,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":25,"end":49,"code":7016,"category":1,"messageKey":"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","messageArgs":["react/jsx-runtime","/home/src/workspaces/project/node_modules/react/jsx-runtime.js"]}]]]} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/index.tsx"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;"],"options":{"jsx":4,"jsxImportSource":"react","module":1,"strict":true},"semanticDiagnosticsPerFile":[[2,[{"pos":25,"end":43,"code":7026,"category":1,"messageKey":"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","messageArgs":["IntrinsicElements"]},{"pos":25,"end":49,"code":7016,"category":1,"messageKey":"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","messageArgs":["react/jsx-runtime","/home/src/workspaces/project/node_modules/react/jsx-runtime.js"]},{"pos":43,"end":49,"code":7026,"category":1,"messageKey":"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","messageArgs":["IntrinsicElements"]}]]]} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -84,8 +94,7 @@ exports.App = App; ], "fileNames": [ "lib.d.ts", - "./src/index.tsx", - "./node_modules/@types/react/index.d.ts" + "./src/index.tsx" ], "fileInfos": [ { @@ -105,18 +114,6 @@ exports.App = App; "version": "0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;", "signature": "0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;", "impliedNodeFormat": "CommonJS" - }, - { - "fileName": "./node_modules/@types/react/index.d.ts", - "version": "a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}", - "signature": "a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}", - "affectsGlobalScope": true, - "impliedNodeFormat": "CommonJS", - "original": { - "version": "a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}", - "affectsGlobalScope": true, - "impliedNodeFormat": 1 - } } ], "options": { @@ -129,6 +126,16 @@ exports.App = App; [ "./src/index.tsx", [ + { + "pos": 25, + "end": 43, + "code": 7026, + "category": 1, + "messageKey": "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", + "messageArgs": [ + "IntrinsicElements" + ] + }, { "pos": 25, "end": 49, @@ -139,16 +146,25 @@ exports.App = App; "react/jsx-runtime", "/home/src/workspaces/project/node_modules/react/jsx-runtime.js" ] + }, + { + "pos": 43, + "end": 49, + "code": 7026, + "category": 1, + "messageKey": "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", + "messageArgs": [ + "IntrinsicElements" + ] } ] ] ], - "size": 1647 + "size": 1643 } tsconfig.json:: SemanticDiagnostics:: *refresh* /home/src/tslibs/TS/Lib/lib.d.ts *refresh* /home/src/workspaces/project/src/index.tsx -*refresh* /home/src/workspaces/project/node_modules/@types/react/index.d.ts Signatures:: diff --git a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash.js b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash.js index 6346e64350..01e833c9c5 100644 --- a/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash.js +++ b/testdata/baselines/reference/tsc/incremental/react-jsx-emit-mode-with-no-backing-types-found-doesnt-crash.js @@ -62,7 +62,7 @@ const App = () => jsx_runtime_1.jsx("div", { propA: true }); exports.App = App; //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/index.tsx","./node_modules/@types/react/index.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;",{"version":"a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"jsx":4,"jsxImportSource":"react","module":1}} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","./src/index.tsx"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},"0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;"],"options":{"jsx":4,"jsxImportSource":"react","module":1}} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", @@ -76,8 +76,7 @@ exports.App = App; ], "fileNames": [ "lib.d.ts", - "./src/index.tsx", - "./node_modules/@types/react/index.d.ts" + "./src/index.tsx" ], "fileInfos": [ { @@ -97,18 +96,6 @@ exports.App = App; "version": "0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;", "signature": "0c3575e38f9aabc971cea9c73a211979-export const App = () =>
;", "impliedNodeFormat": "CommonJS" - }, - { - "fileName": "./node_modules/@types/react/index.d.ts", - "version": "a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}", - "signature": "a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}", - "affectsGlobalScope": true, - "impliedNodeFormat": "CommonJS", - "original": { - "version": "a6afc3c631ce6ad7bc83db84287b52ea-export {};\ndeclare global {\n namespace JSX {\n interface Element {}\n interface IntrinsicElements {\n div: {\n propA?: boolean;\n };\n }\n }\n}", - "affectsGlobalScope": true, - "impliedNodeFormat": 1 - } } ], "options": { @@ -116,12 +103,11 @@ exports.App = App; "jsxImportSource": "react", "module": 1 }, - "size": 1354 + "size": 1008 } tsconfig.json:: SemanticDiagnostics:: *refresh* /home/src/tslibs/TS/Lib/lib.d.ts *refresh* /home/src/workspaces/project/src/index.tsx -*refresh* /home/src/workspaces/project/node_modules/@types/react/index.d.ts Signatures:: diff --git a/testdata/baselines/reference/tsc/libraryResolution/with-config-with-libReplacement.js b/testdata/baselines/reference/tsc/libraryResolution/with-config-with-libReplacement.js index ebc990d5f8..9266d2e814 100644 --- a/testdata/baselines/reference/tsc/libraryResolution/with-config-with-libReplacement.js +++ b/testdata/baselines/reference/tsc/libraryResolution/with-config-with-libReplacement.js @@ -128,13 +128,6 @@ export const y = 10; tsgo -p project1 --explainFiles ExitStatus:: Success Output:: -======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== -Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. -File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. -======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== ======== Resolving module '@typescript/lib-dom' from '/home/src/workspace/projects/project1/__lib_node_modules_lookup_lib.dom.d.ts__.ts'. ======== Module resolution kind is not specified, using 'Bundler'. Resolving in CJS mode with conditions 'require', 'types'. @@ -248,7 +241,6 @@ project1/utils.d.ts Matched by default include pattern '**/*' project1/typeroot1/sometype/index.d.ts Matched by default include pattern '**/*' - Entry point for implicit type library 'sometype' //// [/home/src/workspace/projects/project1/file.d.ts] *new* export declare const file = 10; diff --git a/testdata/baselines/reference/tsc/libraryResolution/with-config.js b/testdata/baselines/reference/tsc/libraryResolution/with-config.js index a6fc4bc0bf..0d78119a3f 100644 --- a/testdata/baselines/reference/tsc/libraryResolution/with-config.js +++ b/testdata/baselines/reference/tsc/libraryResolution/with-config.js @@ -76,13 +76,6 @@ export const y = 10; tsgo -p project1 --explainFiles ExitStatus:: Success Output:: -======== Resolving type reference directive 'sometype', containing file '/home/src/workspace/projects/project1/__inferred type names__.ts', root directory '/home/src/workspace/projects/project1/typeroot1'. ======== -Resolving with primary search path '/home/src/workspace/projects/project1/typeroot1'. -File '/home/src/workspace/projects/project1/typeroot1/sometype.d.ts' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/package.json' does not exist. -File '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts' exists - use it as a name resolution result. -Resolving real path for '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', result '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts'. -======== Type reference directive 'sometype' was successfully resolved to '/home/src/workspace/projects/project1/typeroot1/sometype/index.d.ts', primary: true. ======== ../../tslibs/TS/Lib/lib.es5.d.ts Library referenced via 'es5' from file 'project1/file2.ts' Library 'lib.es5.d.ts' specified in compilerOptions @@ -104,7 +97,6 @@ project1/utils.d.ts Matched by default include pattern '**/*' project1/typeroot1/sometype/index.d.ts Matched by default include pattern '**/*' - Entry point for implicit type library 'sometype' //// [/home/src/tslibs/TS/Lib/lib.es5.d.ts] *Lib* /// interface Boolean {} From 6a48e6489ceb5519dd296aad4d38cef7c4a5805a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 00:47:26 +0000 Subject: [PATCH 3/3] Add getCannotResolveModuleNameErrorForSpecificModule for node core modules; add beforeEach and NodeJS cases Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- internal/checker/checker.go | 21 +++++++++-- .../compiler/elidedJSImport1.errors.txt | 4 +-- .../compiler/elidedJSImport1.errors.txt.diff | 17 --------- ...importAliasInModuleAugmentation.errors.txt | 4 +-- ...tAliasInModuleAugmentation.errors.txt.diff | 18 ---------- ...enthesizedGenericFunctionParsed.errors.txt | 4 +-- ...sizedGenericFunctionParsed.errors.txt.diff | 12 ------- ...ortExportElision(target=es2015).errors.txt | 16 ++++----- ...portElision(target=es2015).errors.txt.diff | 36 ------------------- .../compiler/undeclaredModuleError.errors.txt | 4 +-- .../undeclaredModuleError.errors.txt.diff | 17 --------- .../conformance/emit(jsx=preserve).errors.txt | 4 +-- .../emit(jsx=preserve).errors.txt.diff | 22 ++---------- .../conformance/emit(jsx=react).errors.txt | 4 +-- .../emit(jsx=react).errors.txt.diff | 22 ++---------- 15 files changed, 44 insertions(+), 161 deletions(-) delete mode 100644 testdata/baselines/reference/submodule/compiler/elidedJSImport1.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/importAliasInModuleAugmentation.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/isolatedModulesImportExportElision(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/undeclaredModuleError.errors.txt.diff diff --git a/internal/checker/checker.go b/internal/checker/checker.go index d31b21f5b3..f90d205c12 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -13525,11 +13525,11 @@ func (c *Checker) getCannotFindNameDiagnosticForName(node *ast.Node) *diagnostic return core.IfElse(c.compilerOptions.UsesWildcardTypes(), diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery, diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig) - case "describe", "suite", "it", "test": + case "beforeEach", "describe", "suite", "it", "test": return core.IfElse(c.compilerOptions.UsesWildcardTypes(), diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha, diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig) - case "process", "require", "Buffer", "module": + case "process", "require", "Buffer", "module", "NodeJS": return core.IfElse(c.compilerOptions.UsesWildcardTypes(), diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode, diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig) @@ -14724,11 +14724,26 @@ func (c *Checker) markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration *ast.N } func (c *Checker) resolveExternalModuleName(location *ast.Node, moduleReferenceExpression *ast.Node, ignoreErrors bool) *ast.Symbol { - errorMessage := diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations + errorMessage := c.getCannotResolveModuleNameErrorForSpecificModule(moduleReferenceExpression) + if errorMessage == nil { + errorMessage = diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations + } ignoreErrors = ignoreErrors || c.compilerOptions.NoCheck.IsTrue() return c.resolveExternalModuleNameWorker(location, moduleReferenceExpression, core.IfElse(ignoreErrors, nil, errorMessage), ignoreErrors, false /*isForAugmentation*/) } +func (c *Checker) getCannotResolveModuleNameErrorForSpecificModule(moduleName *ast.Node) *diagnostics.Message { + if ast.IsStringLiteral(moduleName) { + if core.NodeCoreModules()[moduleName.Text()] { + if c.compilerOptions.UsesWildcardTypes() { + return diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode + } + return diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig + } + } + return nil +} + func (c *Checker) resolveExternalModuleNameWorker(location *ast.Node, moduleReferenceExpression *ast.Node, moduleNotFoundError *diagnostics.Message, ignoreErrors bool, isForAugmentation bool) *ast.Symbol { if ast.IsStringLiteralLike(moduleReferenceExpression) { return c.resolveExternalModule(location, moduleReferenceExpression.Text(), moduleNotFoundError, core.IfElse(!ignoreErrors, moduleReferenceExpression, nil), isForAugmentation) diff --git a/testdata/baselines/reference/submodule/compiler/elidedJSImport1.errors.txt b/testdata/baselines/reference/submodule/compiler/elidedJSImport1.errors.txt index 0ceca64b81..f5f8394fd9 100644 --- a/testdata/baselines/reference/submodule/compiler/elidedJSImport1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/elidedJSImport1.errors.txt @@ -1,4 +1,4 @@ -caller.js(1,21): error TS2307: Cannot find module 'fs' or its corresponding type declarations. +caller.js(1,21): error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. caller.js(2,8): error TS18042: 'TruffleContract' is a type and cannot be imported in JavaScript files. Use 'import("@truffle/contract").TruffleContract' in a JSDoc type annotation. caller.js(4,43): error TS2708: Cannot use namespace 'TruffleContract' as a value. caller.js(4,60): error TS2708: Cannot use namespace 'TruffleContract' as a value. @@ -7,7 +7,7 @@ caller.js(4,60): error TS2708: Cannot use namespace 'TruffleContract' as a value ==== caller.js (4 errors) ==== import * as fs from 'fs'; ~~~~ -!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. +!!! error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. import TruffleContract from '@truffle/contract'; // Runtime err: this import is elided in transform ~~~~~~~~~~~~~~~ !!! error TS18042: 'TruffleContract' is a type and cannot be imported in JavaScript files. Use 'import("@truffle/contract").TruffleContract' in a JSDoc type annotation. diff --git a/testdata/baselines/reference/submodule/compiler/elidedJSImport1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/elidedJSImport1.errors.txt.diff deleted file mode 100644 index 17a7386bef..0000000000 --- a/testdata/baselines/reference/submodule/compiler/elidedJSImport1.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.elidedJSImport1.errors.txt -+++ new.elidedJSImport1.errors.txt -@@= skipped -0, +0 lines =@@ --caller.js(1,21): error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+caller.js(1,21): error TS2307: Cannot find module 'fs' or its corresponding type declarations. - caller.js(2,8): error TS18042: 'TruffleContract' is a type and cannot be imported in JavaScript files. Use 'import("@truffle/contract").TruffleContract' in a JSDoc type annotation. - caller.js(4,43): error TS2708: Cannot use namespace 'TruffleContract' as a value. - caller.js(4,60): error TS2708: Cannot use namespace 'TruffleContract' as a value. -@@= skipped -6, +6 lines =@@ - ==== caller.js (4 errors) ==== - import * as fs from 'fs'; - ~~~~ --!!! error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. - import TruffleContract from '@truffle/contract'; // Runtime err: this import is elided in transform - ~~~~~~~~~~~~~~~ - !!! error TS18042: 'TruffleContract' is a type and cannot be imported in JavaScript files. Use 'import("@truffle/contract").TruffleContract' in a JSDoc type annotation. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importAliasInModuleAugmentation.errors.txt b/testdata/baselines/reference/submodule/compiler/importAliasInModuleAugmentation.errors.txt index d8b96f6317..5e8a8c42b9 100644 --- a/testdata/baselines/reference/submodule/compiler/importAliasInModuleAugmentation.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/importAliasInModuleAugmentation.errors.txt @@ -1,5 +1,5 @@ importAliasInModuleAugmentation.ts(12,5): error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. -importAliasInModuleAugmentation.ts(12,24): error TS2307: Cannot find module 'fs' or its corresponding type declarations. +importAliasInModuleAugmentation.ts(12,24): error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== importAliasInModuleAugmentation.ts (2 errors) ==== @@ -18,7 +18,7 @@ importAliasInModuleAugmentation.ts(12,24): error TS2307: Cannot find module 'fs' ~~~~~~ !!! error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. ~~~~ -!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. +!!! error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. } const m: number = x; diff --git a/testdata/baselines/reference/submodule/compiler/importAliasInModuleAugmentation.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/importAliasInModuleAugmentation.errors.txt.diff deleted file mode 100644 index 395064c678..0000000000 --- a/testdata/baselines/reference/submodule/compiler/importAliasInModuleAugmentation.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.importAliasInModuleAugmentation.errors.txt -+++ new.importAliasInModuleAugmentation.errors.txt -@@= skipped -0, +0 lines =@@ - importAliasInModuleAugmentation.ts(12,5): error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. --importAliasInModuleAugmentation.ts(12,24): error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+importAliasInModuleAugmentation.ts(12,24): error TS2307: Cannot find module 'fs' or its corresponding type declarations. - - - ==== importAliasInModuleAugmentation.ts (2 errors) ==== -@@= skipped -17, +17 lines =@@ - ~~~~~~ - !!! error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. - ~~~~ --!!! error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. - } - - const m: number = x; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt b/testdata/baselines/reference/submodule/compiler/importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt index 56390cdc52..fddc165b4c 100644 --- a/testdata/baselines/reference/submodule/compiler/importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt @@ -1,7 +1,7 @@ -importTypeWithUnparenthesizedGenericFunctionParsed.ts(1,36): error TS2307: Cannot find module 'module' or its corresponding type declarations. +importTypeWithUnparenthesizedGenericFunctionParsed.ts(1,36): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== importTypeWithUnparenthesizedGenericFunctionParsed.ts (1 errors) ==== export declare const fail1: import("module").Modifier<(x: T) => T>; // shouldn't be a parse error ~~~~~~~~ -!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. \ No newline at end of file +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt.diff deleted file mode 100644 index 809aeb82d5..0000000000 --- a/testdata/baselines/reference/submodule/compiler/importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt -+++ new.importTypeWithUnparenthesizedGenericFunctionParsed.errors.txt -@@= skipped -0, +0 lines =@@ --importTypeWithUnparenthesizedGenericFunctionParsed.ts(1,36): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+importTypeWithUnparenthesizedGenericFunctionParsed.ts(1,36): error TS2307: Cannot find module 'module' or its corresponding type declarations. - - - ==== importTypeWithUnparenthesizedGenericFunctionParsed.ts (1 errors) ==== - export declare const fail1: import("module").Modifier<(x: T) => T>; // shouldn't be a parse error - ~~~~~~~~ --!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/isolatedModulesImportExportElision(target=es2015).errors.txt b/testdata/baselines/reference/submodule/compiler/isolatedModulesImportExportElision(target=es2015).errors.txt index 77a7a49f3d..d2963ba565 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedModulesImportExportElision(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/compiler/isolatedModulesImportExportElision(target=es2015).errors.txt @@ -1,19 +1,19 @@ -file1.ts(1,17): error TS2307: Cannot find module 'module' or its corresponding type declarations. -file1.ts(2,18): error TS2307: Cannot find module 'module' or its corresponding type declarations. -file1.ts(3,21): error TS2307: Cannot find module 'module' or its corresponding type declarations. -file1.ts(11,18): error TS2307: Cannot find module 'module' or its corresponding type declarations. +file1.ts(1,17): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +file1.ts(2,18): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +file1.ts(3,21): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +file1.ts(11,18): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== file1.ts (4 errors) ==== import {c} from "module" ~~~~~~~~ -!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. import {c2} from "module" ~~~~~~~~ -!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. import * as ns from "module" ~~~~~~~~ -!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. class C extends c2.C { } @@ -23,5 +23,5 @@ file1.ts(11,18): error TS2307: Cannot find module 'module' or its corresponding export {c1} from "module"; ~~~~~~~~ -!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. +!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. export var z = x; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/isolatedModulesImportExportElision(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/isolatedModulesImportExportElision(target=es2015).errors.txt.diff deleted file mode 100644 index bf11b42d35..0000000000 --- a/testdata/baselines/reference/submodule/compiler/isolatedModulesImportExportElision(target=es2015).errors.txt.diff +++ /dev/null @@ -1,36 +0,0 @@ ---- old.isolatedModulesImportExportElision(target=es2015).errors.txt -+++ new.isolatedModulesImportExportElision(target=es2015).errors.txt -@@= skipped -0, +0 lines =@@ --file1.ts(1,17): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. --file1.ts(2,18): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. --file1.ts(3,21): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. --file1.ts(11,18): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+file1.ts(1,17): error TS2307: Cannot find module 'module' or its corresponding type declarations. -+file1.ts(2,18): error TS2307: Cannot find module 'module' or its corresponding type declarations. -+file1.ts(3,21): error TS2307: Cannot find module 'module' or its corresponding type declarations. -+file1.ts(11,18): error TS2307: Cannot find module 'module' or its corresponding type declarations. - - - ==== file1.ts (4 errors) ==== - import {c} from "module" - ~~~~~~~~ --!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. - import {c2} from "module" - ~~~~~~~~ --!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. - import * as ns from "module" - ~~~~~~~~ --!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. - - class C extends c2.C { - } -@@= skipped -22, +22 lines =@@ - - export {c1} from "module"; - ~~~~~~~~ --!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'module' or its corresponding type declarations. - export var z = x; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/undeclaredModuleError.errors.txt b/testdata/baselines/reference/submodule/compiler/undeclaredModuleError.errors.txt index 2960755565..965b4722fa 100644 --- a/testdata/baselines/reference/submodule/compiler/undeclaredModuleError.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/undeclaredModuleError.errors.txt @@ -1,4 +1,4 @@ -undeclaredModuleError.ts(1,21): error TS2307: Cannot find module 'fs' or its corresponding type declarations. +undeclaredModuleError.ts(1,21): error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. undeclaredModuleError.ts(8,29): error TS2345: Argument of type '() => void' is not assignable to parameter of type '(stat: fs.Stats, name: string) => boolean'. Type 'void' is not assignable to type 'boolean'. undeclaredModuleError.ts(11,41): error TS2304: Cannot find name 'IDoNotExist'. @@ -7,7 +7,7 @@ undeclaredModuleError.ts(11,41): error TS2304: Cannot find name 'IDoNotExist'. ==== undeclaredModuleError.ts (3 errors) ==== import fs = require('fs'); ~~~~ -!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. +!!! error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. function readdir(path: string, accept: (stat: fs.Stats, name: string) => boolean, callback: (error: Error, results: { name: string; stat: fs.Stats; }[]) => void ) {} function join(...paths: string[]) {} diff --git a/testdata/baselines/reference/submodule/compiler/undeclaredModuleError.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/undeclaredModuleError.errors.txt.diff deleted file mode 100644 index 95b2d82680..0000000000 --- a/testdata/baselines/reference/submodule/compiler/undeclaredModuleError.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.undeclaredModuleError.errors.txt -+++ new.undeclaredModuleError.errors.txt -@@= skipped -0, +0 lines =@@ --undeclaredModuleError.ts(1,21): error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+undeclaredModuleError.ts(1,21): error TS2307: Cannot find module 'fs' or its corresponding type declarations. - undeclaredModuleError.ts(8,29): error TS2345: Argument of type '() => void' is not assignable to parameter of type '(stat: fs.Stats, name: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. - undeclaredModuleError.ts(11,41): error TS2304: Cannot find name 'IDoNotExist'. -@@= skipped -6, +6 lines =@@ - ==== undeclaredModuleError.ts (3 errors) ==== - import fs = require('fs'); - ~~~~ --!!! error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. - function readdir(path: string, accept: (stat: fs.Stats, name: string) => boolean, callback: (error: Error, results: { name: string; stat: fs.Stats; }[]) => void ) {} - - function join(...paths: string[]) {} \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emit(jsx=preserve).errors.txt b/testdata/baselines/reference/submodule/conformance/emit(jsx=preserve).errors.txt index 894ae70f43..d5c89a8289 100644 --- a/testdata/baselines/reference/submodule/conformance/emit(jsx=preserve).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/emit(jsx=preserve).errors.txt @@ -17,7 +17,7 @@ no.ts(6,16): error TS2307: Cannot find module './foo.d.mts' or its corresponding no.ts(7,16): error TS2307: Cannot find module './foo.d.css.ts' or its corresponding type declarations. no.ts(8,16): error TS2307: Cannot find module '#internal/foo.ts' or its corresponding type declarations. no.ts(9,16): error TS2307: Cannot find module 'node:foo.ts' or its corresponding type declarations. -no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding type declarations. +no.ts(11,8): error TS2591: Cannot find name 'node:path'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== globals.d.ts (0 errors) ==== @@ -108,7 +108,7 @@ no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding t (require)("./foo.ts"); import("node:path"); ~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'node:path' or its corresponding type declarations. +!!! error TS2591: Cannot find name 'node:path'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. require("node:path"); ==== lol.ts (0 errors) ==== diff --git a/testdata/baselines/reference/submodule/conformance/emit(jsx=preserve).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/emit(jsx=preserve).errors.txt.diff index f8a717010e..43159b02f2 100644 --- a/testdata/baselines/reference/submodule/conformance/emit(jsx=preserve).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/emit(jsx=preserve).errors.txt.diff @@ -8,14 +8,7 @@ main.ts(8,15): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. main.ts(10,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. main.ts(11,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. -@@= skipped -15, +14 lines =@@ - no.ts(7,16): error TS2307: Cannot find module './foo.d.css.ts' or its corresponding type declarations. - no.ts(8,16): error TS2307: Cannot find module '#internal/foo.ts' or its corresponding type declarations. - no.ts(9,16): error TS2307: Cannot find module 'node:foo.ts' or its corresponding type declarations. --no.ts(11,8): error TS2591: Cannot find name 'node:path'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding type declarations. - - +@@= skipped -21, +20 lines =@@ ==== globals.d.ts (0 errors) ==== declare function require(module: string): any; @@ -24,7 +17,7 @@ // Rewrite import {} from "./foo.ts"; ~~~~~~~~~~ -@@= skipped -24, +24 lines =@@ +@@= skipped -18, +18 lines =@@ ~~~~~~~~~~ !!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. import "./foo.ts"; @@ -32,13 +25,4 @@ -!!! error TS2882: Cannot find module or type declarations for side-effect import of './foo.ts'. export * from "./foo.ts"; ~~~~~~~~~~ - !!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. -@@= skipped -69, +67 lines =@@ - (require)("./foo.ts"); - import("node:path"); - ~~~~~~~~~~~ --!!! error TS2591: Cannot find name 'node:path'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'node:path' or its corresponding type declarations. - require("node:path"); - - ==== lol.ts (0 errors) ==== \ No newline at end of file + !!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emit(jsx=react).errors.txt b/testdata/baselines/reference/submodule/conformance/emit(jsx=react).errors.txt index 894ae70f43..d5c89a8289 100644 --- a/testdata/baselines/reference/submodule/conformance/emit(jsx=react).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/emit(jsx=react).errors.txt @@ -17,7 +17,7 @@ no.ts(6,16): error TS2307: Cannot find module './foo.d.mts' or its corresponding no.ts(7,16): error TS2307: Cannot find module './foo.d.css.ts' or its corresponding type declarations. no.ts(8,16): error TS2307: Cannot find module '#internal/foo.ts' or its corresponding type declarations. no.ts(9,16): error TS2307: Cannot find module 'node:foo.ts' or its corresponding type declarations. -no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding type declarations. +no.ts(11,8): error TS2591: Cannot find name 'node:path'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ==== globals.d.ts (0 errors) ==== @@ -108,7 +108,7 @@ no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding t (require)("./foo.ts"); import("node:path"); ~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'node:path' or its corresponding type declarations. +!!! error TS2591: Cannot find name 'node:path'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. require("node:path"); ==== lol.ts (0 errors) ==== diff --git a/testdata/baselines/reference/submodule/conformance/emit(jsx=react).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/emit(jsx=react).errors.txt.diff index df29187443..1b81e99bf6 100644 --- a/testdata/baselines/reference/submodule/conformance/emit(jsx=react).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/emit(jsx=react).errors.txt.diff @@ -8,14 +8,7 @@ main.ts(8,15): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. main.ts(10,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. main.ts(11,8): error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. -@@= skipped -15, +14 lines =@@ - no.ts(7,16): error TS2307: Cannot find module './foo.d.css.ts' or its corresponding type declarations. - no.ts(8,16): error TS2307: Cannot find module '#internal/foo.ts' or its corresponding type declarations. - no.ts(9,16): error TS2307: Cannot find module 'node:foo.ts' or its corresponding type declarations. --no.ts(11,8): error TS2591: Cannot find name 'node:path'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+no.ts(11,8): error TS2307: Cannot find module 'node:path' or its corresponding type declarations. - - +@@= skipped -21, +20 lines =@@ ==== globals.d.ts (0 errors) ==== declare function require(module: string): any; @@ -24,7 +17,7 @@ // Rewrite import {} from "./foo.ts"; ~~~~~~~~~~ -@@= skipped -24, +24 lines =@@ +@@= skipped -18, +18 lines =@@ ~~~~~~~~~~ !!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. import "./foo.ts"; @@ -32,13 +25,4 @@ -!!! error TS2882: Cannot find module or type declarations for side-effect import of './foo.ts'. export * from "./foo.ts"; ~~~~~~~~~~ - !!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. -@@= skipped -69, +67 lines =@@ - (require)("./foo.ts"); - import("node:path"); - ~~~~~~~~~~~ --!!! error TS2591: Cannot find name 'node:path'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. -+!!! error TS2307: Cannot find module 'node:path' or its corresponding type declarations. - require("node:path"); - - ==== lol.ts (0 errors) ==== \ No newline at end of file + !!! error TS2307: Cannot find module './foo.ts' or its corresponding type declarations. \ No newline at end of file