diff --git a/internal/checker/nodebuilderimpl.go b/internal/checker/nodebuilderimpl.go index 512bb34c000..10f8a7336a3 100644 --- a/internal/checker/nodebuilderimpl.go +++ b/internal/checker/nodebuilderimpl.go @@ -578,7 +578,7 @@ func (b *NodeBuilderImpl) symbolToTypeNode(symbol *ast.Symbol, mask ast.SymbolFl // If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error // since declaration files with these kinds of references are liable to fail when published :( b.ctx.encounteredError = true - b.ctx.tracker.ReportLikelyUnsafeImportRequiredError(oldSpecifier) + b.ctx.tracker.ReportLikelyUnsafeImportRequiredError(oldSpecifier, symbol.Name) } } diff --git a/internal/checker/symboltracker.go b/internal/checker/symboltracker.go index 2c606c294a0..7cf7b162a57 100644 --- a/internal/checker/symboltracker.go +++ b/internal/checker/symboltracker.go @@ -71,12 +71,12 @@ func (this *SymbolTrackerImpl) ReportCyclicStructureError() { this.inner.ReportCyclicStructureError() } -func (this *SymbolTrackerImpl) ReportLikelyUnsafeImportRequiredError(specifier string) { +func (this *SymbolTrackerImpl) ReportLikelyUnsafeImportRequiredError(specifier string, symbolName string) { this.onDiagnosticReported() if this.inner == nil { return } - this.inner.ReportLikelyUnsafeImportRequiredError(specifier) + this.inner.ReportLikelyUnsafeImportRequiredError(specifier, symbolName) } func (this *SymbolTrackerImpl) ReportTruncationError() { diff --git a/internal/nodebuilder/types.go b/internal/nodebuilder/types.go index aada4c96a52..cdfc32bc98c 100644 --- a/internal/nodebuilder/types.go +++ b/internal/nodebuilder/types.go @@ -12,7 +12,7 @@ type SymbolTracker interface { ReportPrivateInBaseOfClassExpression(propertyName string) ReportInaccessibleUniqueSymbolError() ReportCyclicStructureError() - ReportLikelyUnsafeImportRequiredError(specifier string) + ReportLikelyUnsafeImportRequiredError(specifier string, symbolName string) ReportTruncationError() ReportNonlocalAugmentation(containingFile *ast.SourceFile, parentSymbol *ast.Symbol, augmentingSymbol *ast.Symbol) ReportNonSerializableProperty(propertyName string) diff --git a/internal/transformers/declarations/tracker.go b/internal/transformers/declarations/tracker.go index 0333eb1eea5..3b47d53d3a8 100644 --- a/internal/transformers/declarations/tracker.go +++ b/internal/transformers/declarations/tracker.go @@ -67,10 +67,14 @@ func (s *SymbolTrackerImpl) ReportInferenceFallback(node *ast.Node) { } // ReportLikelyUnsafeImportRequiredError implements checker.SymbolTracker. -func (s *SymbolTrackerImpl) ReportLikelyUnsafeImportRequiredError(specifier string) { +func (s *SymbolTrackerImpl) ReportLikelyUnsafeImportRequiredError(specifier string, symbolName string) { location := s.errorLocation() if location != nil { - s.state.addDiagnostic(createDiagnosticForNode(location, diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, s.errorDeclarationNameWithFallback(), specifier)) + if symbolName != "" { + s.state.addDiagnostic(createDiagnosticForNode(location, diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_2_from_1_This_is_likely_not_portable_A_type_annotation_is_necessary, s.errorDeclarationNameWithFallback(), specifier, symbolName)) + } else { + s.state.addDiagnostic(createDiagnosticForNode(location, diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, s.errorDeclarationNameWithFallback(), specifier)) + } } } diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitCommonJsModuleReferencedType.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitCommonJsModuleReferencedType.errors.txt index 5b208e8259a..7cc3bfb9b7d 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitCommonJsModuleReferencedType.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitCommonJsModuleReferencedType.errors.txt @@ -1,4 +1,4 @@ -r/entry.ts(3,14): error TS2742: The inferred type of 'x' cannot be named without a reference to 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. +r/entry.ts(3,14): error TS2883: The inferred type of 'x' cannot be named without a reference to 'NestedProps' from 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. ==== r/node_modules/foo/node_modules/nested/index.d.ts (0 errors) ==== @@ -23,6 +23,6 @@ r/entry.ts(3,14): error TS2742: The inferred type of 'x' cannot be named without import { bar } from "root"; export const x = foo(); ~ -!!! error TS2742: The inferred type of 'x' cannot be named without a reference to 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'x' cannot be named without a reference to 'NestedProps' from 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. export const y = bar(); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitCommonJsModuleReferencedType.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitCommonJsModuleReferencedType.errors.txt.diff deleted file mode 100644 index ff8111ebc80..00000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitCommonJsModuleReferencedType.errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.declarationEmitCommonJsModuleReferencedType.errors.txt -+++ new.declarationEmitCommonJsModuleReferencedType.errors.txt -@@= skipped -0, +0 lines =@@ --r/entry.ts(3,14): error TS2883: The inferred type of 'x' cannot be named without a reference to 'NestedProps' from 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. -+r/entry.ts(3,14): error TS2742: The inferred type of 'x' cannot be named without a reference to 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. - - - ==== r/node_modules/foo/node_modules/nested/index.d.ts (0 errors) ==== -@@= skipped -22, +22 lines =@@ - import { bar } from "root"; - export const x = foo(); - ~ --!!! error TS2883: The inferred type of 'x' cannot be named without a reference to 'NestedProps' from 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'x' cannot be named without a reference to 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. - export const y = bar(); - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitObjectAssignedDefaultExport.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitObjectAssignedDefaultExport.errors.txt index 1971f0d340c..8396aee5921 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitObjectAssignedDefaultExport.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitObjectAssignedDefaultExport.errors.txt @@ -1,4 +1,4 @@ -index.ts(7,1): error TS2742: The inferred type of 'default' cannot be named without a reference to 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary. +index.ts(7,1): error TS2883: The inferred type of 'default' cannot be named without a reference to 'NonReactStatics' from 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary. ==== node_modules/styled-components/node_modules/hoist-non-react-statics/index.d.ts (0 errors) ==== @@ -43,5 +43,5 @@ index.ts(7,1): error TS2742: The inferred type of 'default' cannot be named with ~~~~~ }); ~~~ -!!! error TS2742: The inferred type of 'default' cannot be named without a reference to 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'default' cannot be named without a reference to 'NonReactStatics' from 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitObjectAssignedDefaultExport.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitObjectAssignedDefaultExport.errors.txt.diff deleted file mode 100644 index d1abd9154e6..00000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitObjectAssignedDefaultExport.errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.declarationEmitObjectAssignedDefaultExport.errors.txt -+++ new.declarationEmitObjectAssignedDefaultExport.errors.txt -@@= skipped -0, +0 lines =@@ --index.ts(7,1): error TS2883: The inferred type of 'default' cannot be named without a reference to 'NonReactStatics' from 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary. -+index.ts(7,1): error TS2742: The inferred type of 'default' cannot be named without a reference to 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary. - - - ==== node_modules/styled-components/node_modules/hoist-non-react-statics/index.d.ts (0 errors) ==== -@@= skipped -42, +42 lines =@@ - ~~~~~ - }); - ~~~ --!!! error TS2883: The inferred type of 'default' cannot be named without a reference to 'NonReactStatics' from 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'default' cannot be named without a reference to 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitReexportedSymlinkReference3.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitReexportedSymlinkReference3.errors.txt index be730da192e..f0520d30e21 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitReexportedSymlinkReference3.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitReexportedSymlinkReference3.errors.txt @@ -1,4 +1,4 @@ -monorepo/pkg3/src/keys.ts(3,14): error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. +monorepo/pkg3/src/keys.ts(3,14): error TS2883: The inferred type of 'ADMIN' cannot be named without a reference to 'IdType' from '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. ==== monorepo/pkg3/tsconfig.json (0 errors) ==== @@ -21,7 +21,7 @@ monorepo/pkg3/src/keys.ts(3,14): error TS2742: The inferred type of 'ADMIN' cann export const ADMIN = MetadataAccessor.create('1'); ~~~~~ -!!! error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'ADMIN' cannot be named without a reference to 'IdType' from '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. ==== monorepo/pkg1/dist/index.d.ts (0 errors) ==== export * from './types'; ==== monorepo/pkg1/dist/types.d.ts (0 errors) ==== diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitReexportedSymlinkReference3.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitReexportedSymlinkReference3.errors.txt.diff deleted file mode 100644 index 18f36cc4d8e..00000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitReexportedSymlinkReference3.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.declarationEmitReexportedSymlinkReference3.errors.txt -+++ new.declarationEmitReexportedSymlinkReference3.errors.txt -@@= skipped -0, +0 lines =@@ --monorepo/pkg3/src/keys.ts(3,14): error TS2883: The inferred type of 'ADMIN' cannot be named without a reference to 'IdType' from '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. -+monorepo/pkg3/src/keys.ts(3,14): error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. - - - ==== monorepo/pkg3/tsconfig.json (0 errors) ==== -@@= skipped -20, +20 lines =@@ - - export const ADMIN = MetadataAccessor.create('1'); - ~~~~~ --!!! error TS2883: The inferred type of 'ADMIN' cannot be named without a reference to 'IdType' from '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. - ==== monorepo/pkg1/dist/index.d.ts (0 errors) ==== - export * from './types'; - ==== monorepo/pkg1/dist/types.d.ts (0 errors) ==== \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnsafeImportSymbolName.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitUnsafeImportSymbolName.errors.txt index d32f3e7e8c0..64c559942c6 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnsafeImportSymbolName.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUnsafeImportSymbolName.errors.txt @@ -1,4 +1,4 @@ -r/entry.ts(2,14): error TS2742: The inferred type of 'special' cannot be named without a reference to 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. +r/entry.ts(2,14): error TS2883: The inferred type of 'special' cannot be named without a reference to 'MySpecialType' from 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. ==== r/node_modules/foo/node_modules/nested/index.d.ts (0 errors) ==== @@ -12,5 +12,5 @@ r/entry.ts(2,14): error TS2742: The inferred type of 'special' cannot be named w import { getSpecial } from "foo"; export const special = getSpecial(); ~~~~~~~ -!!! error TS2742: The inferred type of 'special' cannot be named without a reference to 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'special' cannot be named without a reference to 'MySpecialType' from 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnsafeImportSymbolName.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitUnsafeImportSymbolName.errors.txt.diff deleted file mode 100644 index cf8d3c40970..00000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnsafeImportSymbolName.errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.declarationEmitUnsafeImportSymbolName.errors.txt -+++ new.declarationEmitUnsafeImportSymbolName.errors.txt -@@= skipped -0, +0 lines =@@ --r/entry.ts(2,14): error TS2883: The inferred type of 'special' cannot be named without a reference to 'MySpecialType' from 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. -+r/entry.ts(2,14): error TS2742: The inferred type of 'special' cannot be named without a reference to 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. - - - ==== r/node_modules/foo/node_modules/nested/index.d.ts (0 errors) ==== -@@= skipped -11, +11 lines =@@ - import { getSpecial } from "foo"; - export const special = getSpecial(); - ~~~~~~~ --!!! error TS2883: The inferred type of 'special' cannot be named without a reference to 'MySpecialType' from 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'special' cannot be named without a reference to 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUsingTypeAlias1.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitUsingTypeAlias1.errors.txt index c31e66a237a..15bdbce24b7 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUsingTypeAlias1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUsingTypeAlias1.errors.txt @@ -1,5 +1,6 @@ -src/index.ts(3,14): error TS2742: The inferred type of 'foo' cannot be named without a reference to '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. -src/index.ts(7,14): error TS2742: The inferred type of 'bar' cannot be named without a reference to '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. +src/index.ts(3,14): error TS2883: The inferred type of 'foo' cannot be named without a reference to 'SomeType' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. +src/index.ts(7,14): error TS2883: The inferred type of 'bar' cannot be named without a reference to 'Other' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. +src/index.ts(7,14): error TS2883: The inferred type of 'bar' cannot be named without a reference to 'SomeType' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. ==== node_modules/some-dep/dist/inner.d.ts (0 errors) ==== @@ -18,17 +19,19 @@ src/index.ts(7,14): error TS2742: The inferred type of 'bar' cannot be named wit } } -==== src/index.ts (2 errors) ==== +==== src/index.ts (3 errors) ==== import { SomeType } from "some-dep"; export const foo = (thing: SomeType) => { ~~~ -!!! error TS2742: The inferred type of 'foo' cannot be named without a reference to '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'foo' cannot be named without a reference to 'SomeType' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. return thing; }; export const bar = (thing: SomeType) => { ~~~ -!!! error TS2742: The inferred type of 'bar' cannot be named without a reference to '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'bar' cannot be named without a reference to 'Other' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. + ~~~ +!!! error TS2883: The inferred type of 'bar' cannot be named without a reference to 'SomeType' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. return thing.arg; }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUsingTypeAlias1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitUsingTypeAlias1.errors.txt.diff index e53a44babf0..3150f9b97d0 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUsingTypeAlias1.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUsingTypeAlias1.errors.txt.diff @@ -1,25 +1,26 @@ --- old.declarationEmitUsingTypeAlias1.errors.txt +++ new.declarationEmitUsingTypeAlias1.errors.txt @@= skipped -0, +0 lines =@@ --src/index.ts(3,14): error TS2883: The inferred type of 'foo' cannot be named without a reference to 'SomeType' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. --src/index.ts(7,14): error TS2883: The inferred type of 'bar' cannot be named without a reference to 'Other' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. -+src/index.ts(3,14): error TS2742: The inferred type of 'foo' cannot be named without a reference to '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. -+src/index.ts(7,14): error TS2742: The inferred type of 'bar' cannot be named without a reference to '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. + src/index.ts(3,14): error TS2883: The inferred type of 'foo' cannot be named without a reference to 'SomeType' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. + src/index.ts(7,14): error TS2883: The inferred type of 'bar' cannot be named without a reference to 'Other' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. ++src/index.ts(7,14): error TS2883: The inferred type of 'bar' cannot be named without a reference to 'SomeType' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. ==== node_modules/some-dep/dist/inner.d.ts (0 errors) ==== -@@= skipped -22, +22 lines =@@ +@@= skipped -17, +18 lines =@@ + } + } - export const foo = (thing: SomeType) => { - ~~~ --!!! error TS2883: The inferred type of 'foo' cannot be named without a reference to 'SomeType' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'foo' cannot be named without a reference to '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. - return thing; - }; +-==== src/index.ts (2 errors) ==== ++==== src/index.ts (3 errors) ==== + import { SomeType } from "some-dep"; + export const foo = (thing: SomeType) => { +@@= skipped -12, +12 lines =@@ export const bar = (thing: SomeType) => { ~~~ --!!! error TS2883: The inferred type of 'bar' cannot be named without a reference to 'Other' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'bar' cannot be named without a reference to '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. + !!! error TS2883: The inferred type of 'bar' cannot be named without a reference to 'Other' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. ++ ~~~ ++!!! error TS2883: The inferred type of 'bar' cannot be named without a reference to 'SomeType' from '../node_modules/some-dep/dist/inner'. This is likely not portable. A type annotation is necessary. return thing.arg; }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt b/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt index 6d03f776076..71a7854c008 100644 --- a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt @@ -1,10 +1,10 @@ -index.ts(1,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. +index.ts(1,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. ==== index.ts (1 errors) ==== export const a = async () => (await import("inner")).x(); ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. ==== node_modules/inner/index.d.ts (0 errors) ==== export { x } from "./other.js"; ==== node_modules/inner/other.d.ts (0 errors) ==== diff --git a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt.diff deleted file mode 100644 index b8e06c4bdde..00000000000 --- a/testdata/baselines/reference/submodule/conformance/legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt -+++ new.legacyNodeModulesExportsSpecifierGenerationConditions.errors.txt -@@= skipped -0, +0 lines =@@ --index.ts(1,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. -+index.ts(1,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. - - - ==== index.ts (1 errors) ==== - export const a = async () => (await import("inner")).x(); - ~ --!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/private'. This is likely not portable. A type annotation is necessary. - ==== node_modules/inner/index.d.ts (0 errors) ==== - export { x } from "./other.js"; - ==== node_modules/inner/other.d.ts (0 errors) ==== \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt index 7e86097227b..5f2b9b88ecf 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt @@ -1,5 +1,5 @@ index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== index.ts (2 errors) ==== @@ -9,7 +9,7 @@ index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. export const a = (await import("inner")).x(); ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== node_modules/inner/index.d.ts (0 errors) ==== // esm format file export { x } from "./other.js"; diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt.diff deleted file mode 100644 index d117e830db2..00000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt -+++ new.nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt -@@= skipped -0, +0 lines =@@ - index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. --index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - - - ==== index.ts (2 errors) ==== -@@= skipped -8, +8 lines =@@ - !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~ --!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - ==== node_modules/inner/index.d.ts (0 errors) ==== - // esm format file - export { x } from "./other.js"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt index 7e86097227b..5f2b9b88ecf 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt @@ -1,5 +1,5 @@ index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== index.ts (2 errors) ==== @@ -9,7 +9,7 @@ index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. export const a = (await import("inner")).x(); ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== node_modules/inner/index.d.ts (0 errors) ==== // esm format file export { x } from "./other.js"; diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt.diff deleted file mode 100644 index 9c16eb7b8da..00000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt -+++ new.nodeModulesExportsBlocksSpecifierResolution(module=node18).errors.txt -@@= skipped -0, +0 lines =@@ - index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. --index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - - - ==== index.ts (2 errors) ==== -@@= skipped -8, +8 lines =@@ - !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~ --!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - ==== node_modules/inner/index.d.ts (0 errors) ==== - // esm format file - export { x } from "./other.js"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt index 7e86097227b..5f2b9b88ecf 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt @@ -1,5 +1,5 @@ index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== index.ts (2 errors) ==== @@ -9,7 +9,7 @@ index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. export const a = (await import("inner")).x(); ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== node_modules/inner/index.d.ts (0 errors) ==== // esm format file export { x } from "./other.js"; diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt.diff deleted file mode 100644 index 9bf9f362faa..00000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt -+++ new.nodeModulesExportsBlocksSpecifierResolution(module=node20).errors.txt -@@= skipped -0, +0 lines =@@ - index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. --index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - - - ==== index.ts (2 errors) ==== -@@= skipped -8, +8 lines =@@ - !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~ --!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - ==== node_modules/inner/index.d.ts (0 errors) ==== - // esm format file - export { x } from "./other.js"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt index 7e86097227b..5f2b9b88ecf 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt @@ -1,5 +1,5 @@ index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== index.ts (2 errors) ==== @@ -9,7 +9,7 @@ index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. export const a = (await import("inner")).x(); ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== node_modules/inner/index.d.ts (0 errors) ==== // esm format file export { x } from "./other.js"; diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt.diff deleted file mode 100644 index 9994d362615..00000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt -+++ new.nodeModulesExportsBlocksSpecifierResolution(module=nodenext).errors.txt -@@= skipped -0, +0 lines =@@ - index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. --index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - - - ==== index.ts (2 errors) ==== -@@= skipped -8, +8 lines =@@ - !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~ --!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - ==== node_modules/inner/index.d.ts (0 errors) ==== - // esm format file - export { x } from "./other.js"; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node16).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node16).errors.txt index 358a0e61437..d62434e7004 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node16).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node16).errors.txt @@ -1,5 +1,5 @@ index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== index.ts (2 errors) ==== @@ -9,7 +9,7 @@ index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. export const a = (await import("inner")).x(); ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. import {a as a2} from "package"; ==== node_modules/inner/index.ts (0 errors) ==== // esm format file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node16).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node16).errors.txt.diff deleted file mode 100644 index aea113fa0cb..00000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node16).errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.nodeModulesExportsSourceTs(module=node16).errors.txt -+++ new.nodeModulesExportsSourceTs(module=node16).errors.txt -@@= skipped -0, +0 lines =@@ - index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. --index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - - - ==== index.ts (2 errors) ==== -@@= skipped -8, +8 lines =@@ - !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~ --!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - import {a as a2} from "package"; - ==== node_modules/inner/index.ts (0 errors) ==== - // esm format file \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node18).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node18).errors.txt index 358a0e61437..d62434e7004 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node18).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node18).errors.txt @@ -1,5 +1,5 @@ index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== index.ts (2 errors) ==== @@ -9,7 +9,7 @@ index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. export const a = (await import("inner")).x(); ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. import {a as a2} from "package"; ==== node_modules/inner/index.ts (0 errors) ==== // esm format file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node18).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node18).errors.txt.diff deleted file mode 100644 index 879df35a189..00000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node18).errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.nodeModulesExportsSourceTs(module=node18).errors.txt -+++ new.nodeModulesExportsSourceTs(module=node18).errors.txt -@@= skipped -0, +0 lines =@@ - index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. --index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - - - ==== index.ts (2 errors) ==== -@@= skipped -8, +8 lines =@@ - !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~ --!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - import {a as a2} from "package"; - ==== node_modules/inner/index.ts (0 errors) ==== - // esm format file \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node20).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node20).errors.txt index 358a0e61437..d62434e7004 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node20).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node20).errors.txt @@ -1,5 +1,5 @@ index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== index.ts (2 errors) ==== @@ -9,7 +9,7 @@ index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. export const a = (await import("inner")).x(); ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. import {a as a2} from "package"; ==== node_modules/inner/index.ts (0 errors) ==== // esm format file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node20).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node20).errors.txt.diff deleted file mode 100644 index b6b2334e000..00000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=node20).errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.nodeModulesExportsSourceTs(module=node20).errors.txt -+++ new.nodeModulesExportsSourceTs(module=node20).errors.txt -@@= skipped -0, +0 lines =@@ - index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. --index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - - - ==== index.ts (2 errors) ==== -@@= skipped -8, +8 lines =@@ - !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~ --!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - import {a as a2} from "package"; - ==== node_modules/inner/index.ts (0 errors) ==== - // esm format file \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=nodenext).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=nodenext).errors.txt index 358a0e61437..d62434e7004 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=nodenext).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=nodenext).errors.txt @@ -1,5 +1,5 @@ index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. ==== index.ts (2 errors) ==== @@ -9,7 +9,7 @@ index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. export const a = (await import("inner")).x(); ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. import {a as a2} from "package"; ==== node_modules/inner/index.ts (0 errors) ==== // esm format file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=nodenext).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=nodenext).errors.txt.diff deleted file mode 100644 index 15746305de2..00000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsSourceTs(module=nodenext).errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.nodeModulesExportsSourceTs(module=nodenext).errors.txt -+++ new.nodeModulesExportsSourceTs(module=nodenext).errors.txt -@@= skipped -0, +0 lines =@@ - index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. --index.ts(3,14): error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - - - ==== index.ts (2 errors) ==== -@@= skipped -8, +8 lines =@@ - !!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~ --!!! error TS2883: The inferred type of 'a' cannot be named without a reference to 'Thing' from './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -+!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - import {a as a2} from "package"; - ==== node_modules/inner/index.ts (0 errors) ==== - // esm format file \ No newline at end of file diff --git a/testdata/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js b/testdata/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js index c0b1926068f..d88fd06b7b4 100644 --- a/testdata/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js +++ b/testdata/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js @@ -58,7 +58,7 @@ export const ADMIN = MetadataAccessor.create('1'); tsgo -p pkg3 --explainFiles ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -pkg3/src/keys.ts:2:14 - error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. +pkg3/src/keys.ts:2:14 - error TS2883: The inferred type of 'ADMIN' cannot be named without a reference to 'IdType' from '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary. 2 export const ADMIN = MetadataAccessor.create('1');    ~~~~~