diff --git a/internal/module/resolver.go b/internal/module/resolver.go index d054c1846d..e53ecb2ba7 100644 --- a/internal/module/resolver.go +++ b/internal/module/resolver.go @@ -9,6 +9,7 @@ import ( "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" "github.com/microsoft/typescript-go/internal/diagnostics" + "github.com/microsoft/typescript-go/internal/outputpaths" "github.com/microsoft/typescript-go/internal/packagejson" "github.com/microsoft/typescript-go/internal/semver" "github.com/microsoft/typescript-go/internal/tspath" @@ -54,7 +55,7 @@ type resolutionState struct { resolvedPackageDirectory bool failedLookupLocations []string affectingLocations []string - diagnostics []ast.Diagnostic + diagnostics []*ast.Diagnostic } func newResolutionState( @@ -748,10 +749,175 @@ func (r *resolutionState) loadModuleFromTargetExportOrImport(extensions extensio } func (r *resolutionState) tryLoadInputFileForPath(finalPath string, entry string, packagePath string, isImports bool) *resolved { - // !!! + // Replace any references to outputs for files in the program with the input files to support package self-names used with outDir + // PROBLEM: We don't know how to calculate the output paths yet, because the "common source directory" we use as the base of the file structure + // we reproduce into the output directory is based on the set of input files, which we're still in the process of traversing and resolving! + // _Given that_, we have to guess what the base of the output directory is (obviously the user wrote the export map, so has some idea what it is!). + // We are going to probe _so many_ possible paths. We limit where we'll do this to try to reduce the possibilities of false positive lookups. + if !r.isConfigLookup && + (r.compilerOptions.DeclarationDir != "" || r.compilerOptions.OutDir != "") && + !strings.Contains(finalPath, "/node_modules/") && + (r.compilerOptions.ConfigFilePath == "" || tspath.ContainsPath( + tspath.GetDirectoryPath(packagePath), + r.compilerOptions.ConfigFilePath, + tspath.ComparePathsOptions{ + UseCaseSensitiveFileNames: r.resolver.host.FS().UseCaseSensitiveFileNames(), + CurrentDirectory: r.resolver.host.GetCurrentDirectory(), + }, + )) { + // So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings. + // Even with all that, we still don't know if the root of the output file structure will be (relative to the package file) + // `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.) + + useCaseSensitiveFileNames := r.resolver.host.FS().UseCaseSensitiveFileNames() + var commonSourceDirGuesses []string + + // A `rootDir` compiler option strongly indicates the root location + // A `composite` project is using project references and has it's common src dir set to `.`, so it shouldn't need to check any other locations + if r.compilerOptions.RootDir != "" || (r.compilerOptions.Composite.IsTrue() && r.compilerOptions.ConfigFilePath != "") { + commonDir := tspath.GetNormalizedAbsolutePath(r.getCommonSourceDirectory(), r.resolver.host.GetCurrentDirectory()) + commonSourceDirGuesses = append(commonSourceDirGuesses, commonDir) + } else if r.containingDirectory != "" { + // However without either of those set we're in the dark. Let's say you have + // + // ./tools/index.ts + // ./src/index.ts + // ./dist/index.js + // ./package.json <-- references ./dist/index.js + // ./tsconfig.json <-- loads ./src/index.ts + // + // How do we know `./src` is the common src dir, and not `./tools`, given only the `./dist` out dir and `./dist/index.js` filename? + // Answer: We... don't. We know we're looking for an `index.ts` input file, but we have _no clue_ which subfolder it's supposed to be loaded from + // without more context. + // But we do have more context! Just a tiny bit more! We're resolving an import _for some other input file_! And that input file, too + // must be inside the common source directory! So we propagate that tidbit of info all the way to here via state.containingDirectory + + requestingFile := tspath.GetNormalizedAbsolutePath(tspath.CombinePaths(r.containingDirectory, "index.ts"), r.resolver.host.GetCurrentDirectory()) + // And we can try every folder above the common folder for the request folder and the config/package base directory + // This technically can be wrong - we may load ./src/index.ts when ./src/sub/index.ts was right because we don't + // know if only `./src/sub` files were loaded by the program; but this has the best chance to be right of just about anything + // else we have. And, given that we're about to load `./src/index.ts` because we choose it as likely correct, there will then + // be a file outside of `./src/sub` in the program (the file we resolved to), making us de-facto right. So this fallback lookup + // logic may influence what files are pulled in by self-names, which in turn influences the output path shape, but it's all + // internally consistent so the paths should be stable so long as we prefer the "most general" (meaning: top-most-level directory) possible results first. + commonDir := tspath.GetNormalizedAbsolutePath(r.getCommonSourceDirectoryForFiles([]string{requestingFile, tspath.GetNormalizedAbsolutePath(packagePath, r.resolver.host.GetCurrentDirectory())}), r.resolver.host.GetCurrentDirectory()) + commonSourceDirGuesses = append(commonSourceDirGuesses, commonDir) + + fragment := tspath.EnsureTrailingDirectorySeparator(commonDir) + for len(fragment) > 1 { + parts := tspath.GetPathComponents(fragment, "") + if len(parts) <= 1 { + break + } + parts = parts[:len(parts)-1] // remove a directory + commonDir := tspath.GetPathFromPathComponents(parts) + commonSourceDirGuesses = append([]string{commonDir}, commonSourceDirGuesses...) // unshift + fragment = tspath.EnsureTrailingDirectorySeparator(commonDir) + } + } + + if len(commonSourceDirGuesses) > 1 { + var diagnostic *ast.Diagnostic + if isImports { + diagnostic = ast.NewDiagnostic( + nil, + core.TextRange{}, + diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate, + core.IfElse(entry == "", ".", entry), // replace empty string with `.` - the reverse of the operation done when entries are built - so main entrypoint errors don't look weird + packagePath, + ) + } else { + diagnostic = ast.NewDiagnostic( + nil, + core.TextRange{}, + diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate, + core.IfElse(entry == "", ".", entry), + packagePath, + ) + } + r.diagnostics = append(r.diagnostics, diagnostic) + } + + for _, commonSourceDirGuess := range commonSourceDirGuesses { + candidateDirectories := r.getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) + for _, candidateDir := range candidateDirectories { + if tspath.ContainsPath(candidateDir, finalPath, tspath.ComparePathsOptions{ + UseCaseSensitiveFileNames: useCaseSensitiveFileNames, + CurrentDirectory: r.resolver.host.GetCurrentDirectory(), + }) { + // The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension + pathFragment := finalPath[len(candidateDir)+1:] // +1 to also remove directory separator + possibleInputBase := tspath.CombinePaths(commonSourceDirGuess, pathFragment) + jsAndDtsExtensions := []string{tspath.ExtensionMjs, tspath.ExtensionCjs, tspath.ExtensionJs, tspath.ExtensionJson, tspath.ExtensionDmts, tspath.ExtensionDcts, tspath.ExtensionDts} + for _, ext := range jsAndDtsExtensions { + if tspath.FileExtensionIs(possibleInputBase, ext) { + inputExts := r.getPossibleOriginalInputExtensionForExtension(possibleInputBase) + for _, possibleExt := range inputExts { + if !extensionIsOk(r.extensions, possibleExt) { + continue + } + possibleInputWithInputExtension := tspath.ChangeExtension(possibleInputBase, possibleExt) + if r.resolver.host.FS().FileExists(possibleInputWithInputExtension) { + resolved := r.loadFileNameFromPackageJSONField(r.extensions, possibleInputWithInputExtension, "", false) + if !resolved.shouldContinueSearching() { + return resolved + } + } + } + } + } + } + } + } + } return continueSearching() } +func (r *resolutionState) getCommonSourceDirectory() string { + return outputpaths.GetCommonSourceDirectory( + r.compilerOptions, + func() []string { return []string{} }, // Empty files function for now + r.resolver.host.GetCurrentDirectory(), + r.resolver.host.FS().UseCaseSensitiveFileNames(), + ) +} + +func (r *resolutionState) getCommonSourceDirectoryForFiles(files []string) string { + return outputpaths.GetCommonSourceDirectory( + r.compilerOptions, + func() []string { return files }, + r.resolver.host.GetCurrentDirectory(), + r.resolver.host.FS().UseCaseSensitiveFileNames(), + ) +} + +func (r *resolutionState) getOutputDirectoriesForBaseDirectory(commonSourceDirGuess string) []string { + // Config file output paths are processed to be relative to the host's current directory, while + // otherwise the paths are resolved relative to the common source dir the compiler puts together + currentDir := core.IfElse(r.compilerOptions.ConfigFilePath != "", r.resolver.host.GetCurrentDirectory(), commonSourceDirGuess) + var candidateDirectories []string + if r.compilerOptions.DeclarationDir != "" { + candidateDirectories = append(candidateDirectories, tspath.GetNormalizedAbsolutePath(tspath.CombinePaths(currentDir, r.compilerOptions.DeclarationDir), r.resolver.host.GetCurrentDirectory())) + } + if r.compilerOptions.OutDir != "" && r.compilerOptions.OutDir != r.compilerOptions.DeclarationDir { + candidateDirectories = append(candidateDirectories, tspath.GetNormalizedAbsolutePath(tspath.CombinePaths(currentDir, r.compilerOptions.OutDir), r.resolver.host.GetCurrentDirectory())) + } + return candidateDirectories +} + +func (r *resolutionState) getPossibleOriginalInputExtensionForExtension(path string) []string { + if tspath.FileExtensionIsOneOf(path, []string{tspath.ExtensionDmts, tspath.ExtensionMjs, tspath.ExtensionMts}) { + return []string{tspath.ExtensionMts, tspath.ExtensionMjs} + } + if tspath.FileExtensionIsOneOf(path, []string{tspath.ExtensionDcts, tspath.ExtensionCjs, tspath.ExtensionCts}) { + return []string{tspath.ExtensionCts, tspath.ExtensionCjs} + } + if tspath.FileExtensionIs(path, ".d.json.ts") { + return []string{tspath.ExtensionJson} + } + return []string{tspath.ExtensionTsx, tspath.ExtensionTs, tspath.ExtensionJsx, tspath.ExtensionJs} +} + func (r *resolutionState) loadModuleFromNearestNodeModulesDirectory(typesScopeOnly bool) *resolved { mode := core.ResolutionModeCommonJS if r.esmMode || r.conditionMatches("import") { @@ -1377,7 +1543,7 @@ func (r *resolutionState) loadFileNameFromPackageJSONField(extensions extensions return &resolved{ path: path, extension: extension, - resolvedUsingTsExtension: !strings.HasSuffix(packageJSONValue, extension), + resolvedUsingTsExtension: packageJSONValue != "" && !strings.HasSuffix(packageJSONValue, extension), } } return continueSearching() diff --git a/internal/module/types.go b/internal/module/types.go index d0acc036da..f3c78cc715 100644 --- a/internal/module/types.go +++ b/internal/module/types.go @@ -63,7 +63,7 @@ func (p *PackageId) PackageName() string { type LookupLocations struct { FailedLookupLocations []string AffectingLocations []string - ResolutionDiagnostics []ast.Diagnostic + ResolutionDiagnostics []*ast.Diagnostic } type ResolvedModule struct { diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.errors.txt b/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.errors.txt deleted file mode 100644 index 6bb8c026ab..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -index.ts(1,21): error TS2307: Cannot find module '#dep' or its corresponding type declarations. - - -==== package.json (0 errors) ==== - { - "name": "@this/package", - "type": "module", - "exports": { - ".": "./dist/index.js" - }, - "imports": { - "#dep": "./dist/index.js" - } - } -==== index.ts (1 errors) ==== - import * as me from "#dep"; - ~~~~~~ -!!! error TS2307: Cannot find module '#dep' or its corresponding type declarations. - - me.thing(); - - export function thing(): void {} - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.errors.txt.diff deleted file mode 100644 index b42c3c0180..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.errors.txt.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.nodeNextPackageImportMapRootDir.errors.txt -+++ new.nodeNextPackageImportMapRootDir.errors.txt -@@= skipped -0, +0 lines =@@ -- -+index.ts(1,21): error TS2307: Cannot find module '#dep' or its corresponding type declarations. -+ -+ -+==== package.json (0 errors) ==== -+ { -+ "name": "@this/package", -+ "type": "module", -+ "exports": { -+ ".": "./dist/index.js" -+ }, -+ "imports": { -+ "#dep": "./dist/index.js" -+ } -+ } -+==== index.ts (1 errors) ==== -+ import * as me from "#dep"; -+ ~~~~~~ -+!!! error TS2307: Cannot find module '#dep' or its corresponding type declarations. -+ -+ me.thing(); -+ -+ export function thing(): void {} -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.symbols b/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.symbols index ea09e721ee..5d268641a1 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.symbols +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.symbols @@ -5,7 +5,9 @@ import * as me from "#dep"; >me : Symbol(me, Decl(index.ts, 0, 6)) me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) >me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) export function thing(): void {} >thing : Symbol(thing, Decl(index.ts, 2, 11)) diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.symbols.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.symbols.diff deleted file mode 100644 index d23bac478d..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.symbols.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.nodeNextPackageImportMapRootDir.symbols -+++ new.nodeNextPackageImportMapRootDir.symbols -@@= skipped -4, +4 lines =@@ - >me : Symbol(me, Decl(index.ts, 0, 6)) - - me.thing(); -->me.thing : Symbol(thing, Decl(index.ts, 2, 11)) - >me : Symbol(me, Decl(index.ts, 0, 6)) -->thing : Symbol(thing, Decl(index.ts, 2, 11)) - - export function thing(): void {} - >thing : Symbol(thing, Decl(index.ts, 2, 11)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.types b/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.types index b68e652012..12c154766e 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.types +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.types @@ -2,13 +2,13 @@ === index.ts === import * as me from "#dep"; ->me : any +>me : typeof me me.thing(); ->me.thing() : any ->me.thing : any ->me : any ->thing : any +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void export function thing(): void {} >thing : () => void diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.types.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.types.diff deleted file mode 100644 index 900c137968..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageImportMapRootDir.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.nodeNextPackageImportMapRootDir.types -+++ new.nodeNextPackageImportMapRootDir.types -@@= skipped -1, +1 lines =@@ - - === index.ts === - import * as me from "#dep"; -->me : typeof me -+>me : any - - me.thing(); -->me.thing() : void -->me.thing : () => void -->me : typeof me -->thing : () => void -+>me.thing() : any -+>me.thing : any -+>me : any -+>thing : any - - export function thing(): void {} - >thing : () => void \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.errors.txt b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.errors.txt deleted file mode 100644 index 67aff83133..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - -==== package.json (0 errors) ==== - { - "name": "@this/package", - "type": "module", - "exports": { - ".": "./dist/index.js" - } - } -==== index.ts (1 errors) ==== - import * as me from "@this/package"; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - - export function thing(): void {} - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.errors.txt.diff index cc3c7951f6..35abf0463b 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.errors.txt.diff @@ -5,21 +5,19 @@ - - -!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. -+index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ - ==== package.json (0 errors) ==== - { - "name": "@this/package", -@@= skipped -9, +8 lines =@@ - ".": "./dist/index.js" - } - } +-==== package.json (0 errors) ==== +- { +- "name": "@this/package", +- "type": "module", +- "exports": { +- ".": "./dist/index.js" +- } +- } -==== index.ts (0 errors) ==== -+==== index.ts (1 errors) ==== - import * as me from "@this/package"; -+ ~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - \ No newline at end of file +- import * as me from "@this/package"; +- +- me.thing(); +- +- export function thing(): void {} +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.symbols b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.symbols index a7fc4e2e1d..80a238b132 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.symbols +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.symbols @@ -5,7 +5,9 @@ import * as me from "@this/package"; >me : Symbol(me, Decl(index.ts, 0, 6)) me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) >me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) export function thing(): void {} >thing : Symbol(thing, Decl(index.ts, 2, 11)) diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.symbols.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.symbols.diff deleted file mode 100644 index 81059b55c0..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.symbols.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDir.symbols -+++ new.nodeNextPackageSelfNameWithOutDir.symbols -@@= skipped -4, +4 lines =@@ - >me : Symbol(me, Decl(index.ts, 0, 6)) - - me.thing(); -->me.thing : Symbol(thing, Decl(index.ts, 2, 11)) - >me : Symbol(me, Decl(index.ts, 0, 6)) -->thing : Symbol(thing, Decl(index.ts, 2, 11)) - - export function thing(): void {} - >thing : Symbol(thing, Decl(index.ts, 2, 11)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.types b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.types index 4d89d8bd8b..5b7de921ad 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.types +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.types @@ -2,13 +2,13 @@ === index.ts === import * as me from "@this/package"; ->me : any +>me : typeof me me.thing(); ->me.thing() : any ->me.thing : any ->me : any ->thing : any +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void export function thing(): void {} >thing : () => void diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.types.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.types.diff deleted file mode 100644 index 9e8fc2da9e..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDir.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDir.types -+++ new.nodeNextPackageSelfNameWithOutDir.types -@@= skipped -1, +1 lines =@@ - - === index.ts === - import * as me from "@this/package"; -->me : typeof me -+>me : any - - me.thing(); -->me.thing() : void -->me.thing : () => void -->me : typeof me -->thing : () => void -+>me.thing() : any -+>me.thing : any -+>me : any -+>thing : any - - export function thing(): void {} - >thing : () => void \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt deleted file mode 100644 index c717ff4c92..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - -==== package.json (0 errors) ==== - { - "name": "@this/package", - "type": "module", - "exports": { - ".": { - "default": "./dist/index.js", - "types": "./types/index.d.ts" - } - } - } -==== index.ts (1 errors) ==== - import * as me from "@this/package"; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - - export function thing(): void {} - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt.diff index 6d0833fe41..d46f6efd9d 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt.diff @@ -5,21 +5,22 @@ - - -!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. -+index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ - ==== package.json (0 errors) ==== - { - "name": "@this/package", -@@= skipped -12, +11 lines =@@ - } - } - } +-==== package.json (0 errors) ==== +- { +- "name": "@this/package", +- "type": "module", +- "exports": { +- ".": { +- "default": "./dist/index.js", +- "types": "./types/index.d.ts" +- } +- } +- } -==== index.ts (0 errors) ==== -+==== index.ts (1 errors) ==== - import * as me from "@this/package"; -+ ~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - \ No newline at end of file +- import * as me from "@this/package"; +- +- me.thing(); +- +- export function thing(): void {} +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.symbols b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.symbols index 9f75119c4a..23b246200c 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.symbols +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.symbols @@ -5,7 +5,9 @@ import * as me from "@this/package"; >me : Symbol(me, Decl(index.ts, 0, 6)) me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) >me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) export function thing(): void {} >thing : Symbol(thing, Decl(index.ts, 2, 11)) diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.symbols.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.symbols.diff deleted file mode 100644 index 6fa4367955..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.symbols.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDir.symbols -+++ new.nodeNextPackageSelfNameWithOutDirDeclDir.symbols -@@= skipped -4, +4 lines =@@ - >me : Symbol(me, Decl(index.ts, 0, 6)) - - me.thing(); -->me.thing : Symbol(thing, Decl(index.ts, 2, 11)) - >me : Symbol(me, Decl(index.ts, 0, 6)) -->thing : Symbol(thing, Decl(index.ts, 2, 11)) - - export function thing(): void {} - >thing : Symbol(thing, Decl(index.ts, 2, 11)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.types b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.types index 5ab49769a5..eb6b45ec9c 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.types +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.types @@ -2,13 +2,13 @@ === index.ts === import * as me from "@this/package"; ->me : any +>me : typeof me me.thing(); ->me.thing() : any ->me.thing : any ->me : any ->thing : any +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void export function thing(): void {} >thing : () => void diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.types.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.types.diff deleted file mode 100644 index d04e9b6454..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDir.types -+++ new.nodeNextPackageSelfNameWithOutDirDeclDir.types -@@= skipped -1, +1 lines =@@ - - === index.ts === - import * as me from "@this/package"; -->me : typeof me -+>me : any - - me.thing(); -->me.thing() : void -->me.thing : () => void -->me : typeof me -->thing : () => void -+>me.thing() : any -+>me.thing : any -+>me : any -+>thing : any - - export function thing(): void {} - >thing : () => void \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.errors.txt b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.errors.txt deleted file mode 100644 index 94d98a813d..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.errors.txt +++ /dev/null @@ -1,32 +0,0 @@ -index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - -==== tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "module": "nodenext", - "outDir": "./dist", - "declarationDir": "./types", - "composite": true - } - } -==== index.ts (1 errors) ==== - import * as me from "@this/package"; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - - export function thing(): void {} - -==== package.json (0 errors) ==== - { - "name": "@this/package", - "type": "module", - "exports": { - ".": { - "default": "./dist/index.js", - "types": "./types/index.d.ts" - } - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.errors.txt.diff deleted file mode 100644 index 7d11a0b922..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.errors.txt.diff +++ /dev/null @@ -1,36 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDirComposite.errors.txt -+++ new.nodeNextPackageSelfNameWithOutDirDeclDirComposite.errors.txt -@@= skipped -0, +0 lines =@@ -- -+index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ -+==== tsconfig.json (0 errors) ==== -+ { -+ "compilerOptions": { -+ "module": "nodenext", -+ "outDir": "./dist", -+ "declarationDir": "./types", -+ "composite": true -+ } -+ } -+==== index.ts (1 errors) ==== -+ import * as me from "@this/package"; -+ ~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ me.thing(); -+ -+ export function thing(): void {} -+ -+==== package.json (0 errors) ==== -+ { -+ "name": "@this/package", -+ "type": "module", -+ "exports": { -+ ".": { -+ "default": "./dist/index.js", -+ "types": "./types/index.d.ts" -+ } -+ } -+ } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols index fad765ba6f..12f74f2167 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols @@ -5,7 +5,9 @@ import * as me from "@this/package"; >me : Symbol(me, Decl(index.ts, 0, 6)) me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) >me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) export function thing(): void {} >thing : Symbol(thing, Decl(index.ts, 2, 11)) diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols.diff deleted file mode 100644 index ac6c21f8ef..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols -+++ new.nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols -@@= skipped -4, +4 lines =@@ - >me : Symbol(me, Decl(index.ts, 0, 6)) - - me.thing(); -->me.thing : Symbol(thing, Decl(index.ts, 2, 11)) - >me : Symbol(me, Decl(index.ts, 0, 6)) -->thing : Symbol(thing, Decl(index.ts, 2, 11)) - - export function thing(): void {} - >thing : Symbol(thing, Decl(index.ts, 2, 11)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types index 0312d872ba..a4654ce72c 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types @@ -2,13 +2,13 @@ === index.ts === import * as me from "@this/package"; ->me : any +>me : typeof me me.thing(); ->me.thing() : any ->me.thing : any ->me : any ->thing : any +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void export function thing(): void {} >thing : () => void diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types.diff deleted file mode 100644 index 5b1a188279..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDirComposite.types -+++ new.nodeNextPackageSelfNameWithOutDirDeclDirComposite.types -@@= skipped -1, +1 lines =@@ - - === index.ts === - import * as me from "@this/package"; -->me : typeof me -+>me : any - - me.thing(); -->me.thing() : void -->me.thing : () => void -->me : typeof me -->thing : () => void -+>me.thing() : any -+>me.thing : any -+>me : any -+>thing : any - - export function thing(): void {} - >thing : () => void \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.errors.txt b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.errors.txt deleted file mode 100644 index 78b1581d01..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.errors.txt +++ /dev/null @@ -1,42 +0,0 @@ -src/thing.ts(8,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - -==== tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "module": "nodenext", - "outDir": "./dist", - "declarationDir": "./types", - "composite": true - } - } -==== index.ts (0 errors) ==== - export {srcthing as thing} from "./src/thing.js"; -==== src/thing.ts (1 errors) ==== - // The following import should cause `index.ts` - // to be included in the build, which will, - // in turn, cause the common src directory to not be `src` - // (the harness is wierd here in that noImplicitReferences makes only - // this file get loaded as an entrypoint and emitted, while on the - // real command-line we'll crawl the imports for that set - a limitation - // of the harness, I suppose) - import * as me from "@this/package"; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - - export function srcthing(): void {} - - -==== package.json (0 errors) ==== - { - "name": "@this/package", - "type": "module", - "exports": { - ".": { - "default": "./dist/index.js", - "types": "./types/index.d.ts" - } - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.errors.txt.diff deleted file mode 100644 index 4b52c81320..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.errors.txt.diff +++ /dev/null @@ -1,46 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.errors.txt -+++ new.nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.errors.txt -@@= skipped -0, +0 lines =@@ -- -+src/thing.ts(8,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ -+==== tsconfig.json (0 errors) ==== -+ { -+ "compilerOptions": { -+ "module": "nodenext", -+ "outDir": "./dist", -+ "declarationDir": "./types", -+ "composite": true -+ } -+ } -+==== index.ts (0 errors) ==== -+ export {srcthing as thing} from "./src/thing.js"; -+==== src/thing.ts (1 errors) ==== -+ // The following import should cause `index.ts` -+ // to be included in the build, which will, -+ // in turn, cause the common src directory to not be `src` -+ // (the harness is wierd here in that noImplicitReferences makes only -+ // this file get loaded as an entrypoint and emitted, while on the -+ // real command-line we'll crawl the imports for that set - a limitation -+ // of the harness, I suppose) -+ import * as me from "@this/package"; -+ ~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ me.thing(); -+ -+ export function srcthing(): void {} -+ -+ -+==== package.json (0 errors) ==== -+ { -+ "name": "@this/package", -+ "type": "module", -+ "exports": { -+ ".": { -+ "default": "./dist/index.js", -+ "types": "./types/index.d.ts" -+ } -+ } -+ } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols index 8325dd2aef..0aca3867f1 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols @@ -17,7 +17,9 @@ import * as me from "@this/package"; >me : Symbol(me, Decl(thing.ts, 7, 6)) me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 0, 8)) >me : Symbol(me, Decl(thing.ts, 7, 6)) +>thing : Symbol(thing, Decl(index.ts, 0, 8)) export function srcthing(): void {} >srcthing : Symbol(srcthing, Decl(thing.ts, 9, 11)) diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols.diff index c477bfdd8e..a28cda674e 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols.diff @@ -5,8 +5,10 @@ me.thing(); ->me.thing : Symbol(me.thing, Decl(index.ts, 0, 8)) ++>me.thing : Symbol(thing, Decl(index.ts, 0, 8)) >me : Symbol(me, Decl(thing.ts, 7, 6)) ->thing : Symbol(me.thing, Decl(index.ts, 0, 8)) ++>thing : Symbol(thing, Decl(index.ts, 0, 8)) export function srcthing(): void {} >srcthing : Symbol(srcthing, Decl(thing.ts, 9, 11)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types index 21e392eb8b..d65e7900aa 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types @@ -14,13 +14,13 @@ export {srcthing as thing} from "./src/thing.js"; // real command-line we'll crawl the imports for that set - a limitation // of the harness, I suppose) import * as me from "@this/package"; ->me : any +>me : typeof me me.thing(); ->me.thing() : any ->me.thing : any ->me : any ->thing : any +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void export function srcthing(): void {} >srcthing : () => void diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types.diff deleted file mode 100644 index f353a36a66..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types -+++ new.nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types -@@= skipped -13, +13 lines =@@ - // real command-line we'll crawl the imports for that set - a limitation - // of the harness, I suppose) - import * as me from "@this/package"; -->me : typeof me -+>me : any - - me.thing(); -->me.thing() : void -->me.thing : () => void -->me : typeof me -->thing : () => void -+>me.thing() : any -+>me.thing : any -+>me : any -+>thing : any - - export function srcthing(): void {} - >srcthing : () => void \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt deleted file mode 100644 index d253a0fa23..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt +++ /dev/null @@ -1,42 +0,0 @@ -src/thing.ts(8,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - -==== tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "module": "nodenext", - "outDir": "./dist", - "declarationDir": "./types", - "declaration": true - } - } -==== index.ts (0 errors) ==== - export {srcthing as thing} from "./src/thing.js"; -==== src/thing.ts (1 errors) ==== - // The following import should cause `index.ts` - // to be included in the build, which will, - // in turn, cause the common src directory to not be `src` - // (the harness is wierd here in that noImplicitReferences makes only - // this file get loaded as an entrypoint and emitted, while on the - // real command-line we'll crawl the imports for that set - a limitation - // of the harness, I suppose) - import * as me from "@this/package"; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - - export function srcthing(): void {} - - -==== package.json (0 errors) ==== - { - "name": "@this/package", - "type": "module", - "exports": { - ".": { - "default": "./dist/index.js", - "types": "./types/index.d.ts" - } - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt.diff index 331017e8ed..ba75c52cb2 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt.diff @@ -5,27 +5,41 @@ - - -!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate. -+src/thing.ts(8,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ - ==== tsconfig.json (0 errors) ==== - { - "compilerOptions": { -@@= skipped -12, +11 lines =@@ - } - ==== index.ts (0 errors) ==== - export {srcthing as thing} from "./src/thing.js"; +-==== tsconfig.json (0 errors) ==== +- { +- "compilerOptions": { +- "module": "nodenext", +- "outDir": "./dist", +- "declarationDir": "./types", +- "declaration": true +- } +- } +-==== index.ts (0 errors) ==== +- export {srcthing as thing} from "./src/thing.js"; -==== src/thing.ts (0 errors) ==== -+==== src/thing.ts (1 errors) ==== - // The following import should cause `index.ts` - // to be included in the build, which will, - // in turn, cause the common src directory to not be `src` -@@= skipped -9, +9 lines =@@ - // real command-line we'll crawl the imports for that set - a limitation - // of the harness, I suppose) - import * as me from "@this/package"; -+ ~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - \ No newline at end of file +- // The following import should cause `index.ts` +- // to be included in the build, which will, +- // in turn, cause the common src directory to not be `src` +- // (the harness is wierd here in that noImplicitReferences makes only +- // this file get loaded as an entrypoint and emitted, while on the +- // real command-line we'll crawl the imports for that set - a limitation +- // of the harness, I suppose) +- import * as me from "@this/package"; +- +- me.thing(); +- +- export function srcthing(): void {} +- +- +-==== package.json (0 errors) ==== +- { +- "name": "@this/package", +- "type": "module", +- "exports": { +- ".": { +- "default": "./dist/index.js", +- "types": "./types/index.d.ts" +- } +- } +- } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols index 0cd32d19d7..f4d32f11a9 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols @@ -17,7 +17,9 @@ import * as me from "@this/package"; >me : Symbol(me, Decl(thing.ts, 7, 6)) me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 0, 8)) >me : Symbol(me, Decl(thing.ts, 7, 6)) +>thing : Symbol(thing, Decl(index.ts, 0, 8)) export function srcthing(): void {} >srcthing : Symbol(srcthing, Decl(thing.ts, 9, 11)) diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols.diff index 2d5893b203..a622e73c4d 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols.diff @@ -5,8 +5,10 @@ me.thing(); ->me.thing : Symbol(me.thing, Decl(index.ts, 0, 8)) ++>me.thing : Symbol(thing, Decl(index.ts, 0, 8)) >me : Symbol(me, Decl(thing.ts, 7, 6)) ->thing : Symbol(me.thing, Decl(index.ts, 0, 8)) ++>thing : Symbol(thing, Decl(index.ts, 0, 8)) export function srcthing(): void {} >srcthing : Symbol(srcthing, Decl(thing.ts, 9, 11)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types index fa5240b00c..fe50376388 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types @@ -14,13 +14,13 @@ export {srcthing as thing} from "./src/thing.js"; // real command-line we'll crawl the imports for that set - a limitation // of the harness, I suppose) import * as me from "@this/package"; ->me : any +>me : typeof me me.thing(); ->me.thing() : any ->me.thing : any ->me : any ->thing : any +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void export function srcthing(): void {} >srcthing : () => void diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types.diff deleted file mode 100644 index 6ad9c105ab..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types -+++ new.nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types -@@= skipped -13, +13 lines =@@ - // real command-line we'll crawl the imports for that set - a limitation - // of the harness, I suppose) - import * as me from "@this/package"; -->me : typeof me -+>me : any - - me.thing(); -->me.thing() : void -->me.thing : () => void -->me : typeof me -->thing : () => void -+>me.thing() : any -+>me.thing : any -+>me : any -+>thing : any - - export function srcthing(): void {} - >srcthing : () => void \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.errors.txt b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.errors.txt deleted file mode 100644 index b061751a7d..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -/pkg/src/index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - -==== /pkg/package.json (0 errors) ==== - { - "name": "@this/package", - "type": "module", - "exports": { - ".": { - "default": "./dist/index.js", - "types": "./types/index.d.ts" - } - } - } -==== /pkg/src/index.ts (1 errors) ==== - import * as me from "@this/package"; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - - export function thing(): void {} - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.errors.txt.diff deleted file mode 100644 index 4fc7bb5161..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.errors.txt.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDirRootDir.errors.txt -+++ new.nodeNextPackageSelfNameWithOutDirDeclDirRootDir.errors.txt -@@= skipped -0, +0 lines =@@ -- -+/pkg/src/index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ -+==== /pkg/package.json (0 errors) ==== -+ { -+ "name": "@this/package", -+ "type": "module", -+ "exports": { -+ ".": { -+ "default": "./dist/index.js", -+ "types": "./types/index.d.ts" -+ } -+ } -+ } -+==== /pkg/src/index.ts (1 errors) ==== -+ import * as me from "@this/package"; -+ ~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ me.thing(); -+ -+ export function thing(): void {} -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols index aa0693e551..e39890387d 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols @@ -5,7 +5,9 @@ import * as me from "@this/package"; >me : Symbol(me, Decl(index.ts, 0, 6)) me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) >me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) export function thing(): void {} >thing : Symbol(thing, Decl(index.ts, 2, 11)) diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols.diff deleted file mode 100644 index a45d9af058..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols -+++ new.nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols -@@= skipped -4, +4 lines =@@ - >me : Symbol(me, Decl(index.ts, 0, 6)) - - me.thing(); -->me.thing : Symbol(thing, Decl(index.ts, 2, 11)) - >me : Symbol(me, Decl(index.ts, 0, 6)) -->thing : Symbol(thing, Decl(index.ts, 2, 11)) - - export function thing(): void {} - >thing : Symbol(thing, Decl(index.ts, 2, 11)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types index 23598d5833..08aab042b7 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types @@ -2,13 +2,13 @@ === /pkg/src/index.ts === import * as me from "@this/package"; ->me : any +>me : typeof me me.thing(); ->me.thing() : any ->me.thing : any ->me : any ->thing : any +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void export function thing(): void {} >thing : () => void diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types.diff deleted file mode 100644 index 3aeeb74b2d..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types -+++ new.nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types -@@= skipped -1, +1 lines =@@ - - === /pkg/src/index.ts === - import * as me from "@this/package"; -->me : typeof me -+>me : any - - me.thing(); -->me.thing() : void -->me.thing : () => void -->me : typeof me -->thing : () => void -+>me.thing() : any -+>me.thing : any -+>me : any -+>thing : any - - export function thing(): void {} - >thing : () => void \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.errors.txt b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.errors.txt deleted file mode 100644 index 67aff83133..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - -==== package.json (0 errors) ==== - { - "name": "@this/package", - "type": "module", - "exports": { - ".": "./dist/index.js" - } - } -==== index.ts (1 errors) ==== - import * as me from "@this/package"; - ~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. - - me.thing(); - - export function thing(): void {} - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.errors.txt.diff deleted file mode 100644 index e291447b20..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.errors.txt.diff +++ /dev/null @@ -1,24 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirRootDir.errors.txt -+++ new.nodeNextPackageSelfNameWithOutDirRootDir.errors.txt -@@= skipped -0, +0 lines =@@ -- -+index.ts(1,21): error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ -+==== package.json (0 errors) ==== -+ { -+ "name": "@this/package", -+ "type": "module", -+ "exports": { -+ ".": "./dist/index.js" -+ } -+ } -+==== index.ts (1 errors) ==== -+ import * as me from "@this/package"; -+ ~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module '@this/package' or its corresponding type declarations. -+ -+ me.thing(); -+ -+ export function thing(): void {} -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.symbols b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.symbols index 92e460ce36..8374eeed78 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.symbols +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.symbols @@ -5,7 +5,9 @@ import * as me from "@this/package"; >me : Symbol(me, Decl(index.ts, 0, 6)) me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) >me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) export function thing(): void {} >thing : Symbol(thing, Decl(index.ts, 2, 11)) diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.symbols.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.symbols.diff deleted file mode 100644 index 7f60766aaf..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.symbols.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirRootDir.symbols -+++ new.nodeNextPackageSelfNameWithOutDirRootDir.symbols -@@= skipped -4, +4 lines =@@ - >me : Symbol(me, Decl(index.ts, 0, 6)) - - me.thing(); -->me.thing : Symbol(thing, Decl(index.ts, 2, 11)) - >me : Symbol(me, Decl(index.ts, 0, 6)) -->thing : Symbol(thing, Decl(index.ts, 2, 11)) - - export function thing(): void {} - >thing : Symbol(thing, Decl(index.ts, 2, 11)) \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.types b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.types index 68b55b6266..22d6d440c5 100644 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.types +++ b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.types @@ -2,13 +2,13 @@ === index.ts === import * as me from "@this/package"; ->me : any +>me : typeof me me.thing(); ->me.thing() : any ->me.thing : any ->me : any ->thing : any +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void export function thing(): void {} >thing : () => void diff --git a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.types.diff b/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.types.diff deleted file mode 100644 index 72dfaaad3a..0000000000 --- a/testdata/baselines/reference/submodule/compiler/nodeNextPackageSelfNameWithOutDirRootDir.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.nodeNextPackageSelfNameWithOutDirRootDir.types -+++ new.nodeNextPackageSelfNameWithOutDirRootDir.types -@@= skipped -1, +1 lines =@@ - - === index.ts === - import * as me from "@this/package"; -->me : typeof me -+>me : any - - me.thing(); -->me.thing() : void -->me.thing : () => void -->me : typeof me -->thing : () => void -+>me.thing() : any -+>me.thing : any -+>me : any -+>thing : any - - export function thing(): void {} - >thing : () => void \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.errors.txt b/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.errors.txt deleted file mode 100644 index 988844a868..0000000000 --- a/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.errors.txt +++ /dev/null @@ -1,38 +0,0 @@ -/src/main.ts(2,27): error TS2307: Cannot find module 'pkg/indirect2.js' or its corresponding type declarations. - - -==== /tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "module": "nodenext", - "outDir": "dist", - "rootDir": "src", - }, - "files": ["src/main.ts"] - } - -==== /src/main.ts (1 errors) ==== - import { indirect1 } from "#indirect1"; - import { indirect2 } from "pkg/indirect2.js"; - ~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'pkg/indirect2.js' or its corresponding type declarations. - console.log(indirect1, indirect2); - -==== /package.json (0 errors) ==== - { - "name": "pkg", - "type": "module", - "imports": { - "#indirect1": "./src/indirect1.ts" - }, - "exports": { - "./*": "./dist/*" - } - } - -==== /src/indirect1.ts (0 errors) ==== - export const indirect1 = 0; - -==== /src/indirect2.ts (0 errors) ==== - export const indirect2 = 0; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.errors.txt.diff deleted file mode 100644 index bc3a93722f..0000000000 --- a/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.errors.txt.diff +++ /dev/null @@ -1,42 +0,0 @@ ---- old.selfNameAndImportsEmitInclusion.errors.txt -+++ new.selfNameAndImportsEmitInclusion.errors.txt -@@= skipped -0, +0 lines =@@ -- -+/src/main.ts(2,27): error TS2307: Cannot find module 'pkg/indirect2.js' or its corresponding type declarations. -+ -+ -+==== /tsconfig.json (0 errors) ==== -+ { -+ "compilerOptions": { -+ "module": "nodenext", -+ "outDir": "dist", -+ "rootDir": "src", -+ }, -+ "files": ["src/main.ts"] -+ } -+ -+==== /src/main.ts (1 errors) ==== -+ import { indirect1 } from "#indirect1"; -+ import { indirect2 } from "pkg/indirect2.js"; -+ ~~~~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module 'pkg/indirect2.js' or its corresponding type declarations. -+ console.log(indirect1, indirect2); -+ -+==== /package.json (0 errors) ==== -+ { -+ "name": "pkg", -+ "type": "module", -+ "imports": { -+ "#indirect1": "./src/indirect1.ts" -+ }, -+ "exports": { -+ "./*": "./dist/*" -+ } -+ } -+ -+==== /src/indirect1.ts (0 errors) ==== -+ export const indirect1 = 0; -+ -+==== /src/indirect2.ts (0 errors) ==== -+ export const indirect2 = 0; -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.js b/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.js index 15f62d8d28..e8e1e014ab 100644 --- a/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.js +++ b/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.js @@ -26,6 +26,8 @@ console.log(indirect1, indirect2); //// [indirect1.js] export const indirect1 = 0; +//// [indirect2.js] +export const indirect2 = 0; //// [main.js] import { indirect1 } from "#indirect1"; import { indirect2 } from "pkg/indirect2.js"; diff --git a/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.js.diff b/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.js.diff deleted file mode 100644 index 94915b9bc2..0000000000 --- a/testdata/baselines/reference/submodule/compiler/selfNameAndImportsEmitInclusion.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.selfNameAndImportsEmitInclusion.js -+++ new.selfNameAndImportsEmitInclusion.js -@@= skipped -25, +25 lines =@@ - - //// [indirect1.js] - export const indirect1 = 0; --//// [indirect2.js] --export const indirect2 = 0; - //// [main.js] - import { indirect1 } from "#indirect1"; - import { indirect2 } from "pkg/indirect2.js"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.symbols b/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.symbols index 236a605968..cf553ecca4 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.symbols +++ b/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.symbols @@ -8,7 +8,3 @@ export const foo = 1; import { foo } from "js-self-name-import/foo.js"; >foo : Symbol(foo, Decl(foo.js, 0, 8)) -=== /types/src/foo.d.ts === -export const foo: 1; ->foo : Symbol(foo, Decl(foo.d.ts, 0, 12)) - diff --git a/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.symbols.diff b/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.symbols.diff deleted file mode 100644 index d78f58e9f7..0000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.symbols.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.nodeAllowJsPackageSelfName2.symbols -+++ new.nodeAllowJsPackageSelfName2.symbols -@@= skipped -7, +7 lines =@@ - import { foo } from "js-self-name-import/foo.js"; - >foo : Symbol(foo, Decl(foo.js, 0, 8)) - -+=== /types/src/foo.d.ts === -+export const foo: 1; -+>foo : Symbol(foo, Decl(foo.d.ts, 0, 12)) -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.types b/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.types index bc6fa3d56b..b5d4bfc7cf 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.types +++ b/testdata/baselines/reference/submodule/conformance/nodeAllowJsPackageSelfName2.types @@ -9,7 +9,3 @@ export const foo = 1; import { foo } from "js-self-name-import/foo.js"; >foo : 1 -=== /types/src/foo.d.ts === -export const foo: 1; ->foo : 1 - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeAllowJsPackageSelfName2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeAllowJsPackageSelfName2.types.diff deleted file mode 100644 index fc132a3084..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeAllowJsPackageSelfName2.types.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.nodeAllowJsPackageSelfName2.types -+++ new.nodeAllowJsPackageSelfName2.types -@@= skipped -8, +8 lines =@@ - import { foo } from "js-self-name-import/foo.js"; - >foo : 1 - -+=== /types/src/foo.d.ts === -+export const foo: 1; -+>foo : 1 -+ \ No newline at end of file