forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use features for selected module resolution rather than all features …
…for type reference directives, since they can add restrictions to resolutions
- Loading branch information
Showing
13 changed files
with
190 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=commonjs).js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//// [tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts] //// | ||
|
||
//// [index.d.ts] | ||
interface GlobalThing { a: number } | ||
//// [package.json] | ||
{ | ||
"name": "pkg", | ||
"types": "index.d.ts", | ||
"exports": "some-other-thing.js" | ||
} | ||
//// [usage.ts] | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; | ||
|
||
//// [usage.js] | ||
/// <reference types="pkg" /> | ||
var a = { a: 0 }; |
13 changes: 13 additions & 0 deletions
13
.../baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=commonjs).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
=== tests/cases/compiler/node_modules/pkg/index.d.ts === | ||
interface GlobalThing { a: number } | ||
>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) | ||
>a : Symbol(GlobalThing.a, Decl(index.d.ts, 0, 23)) | ||
|
||
=== tests/cases/compiler/usage.ts === | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; | ||
>a : Symbol(a, Decl(usage.ts, 2, 5)) | ||
>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) | ||
>a : Symbol(a, Decl(usage.ts, 2, 24)) | ||
|
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=commonjs).types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
=== tests/cases/compiler/node_modules/pkg/index.d.ts === | ||
interface GlobalThing { a: number } | ||
>a : number | ||
|
||
=== tests/cases/compiler/usage.ts === | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; | ||
>a : GlobalThing | ||
>{ a: 0 } : { a: number; } | ||
>a : number | ||
>0 : 0 | ||
|
17 changes: 17 additions & 0 deletions
17
...baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
tests/cases/compiler/usage.ts(1,23): error TS2688: Cannot find type definition file for 'pkg'. | ||
|
||
|
||
==== tests/cases/compiler/node_modules/pkg/index.d.ts (0 errors) ==== | ||
interface GlobalThing { a: number } | ||
==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== | ||
{ | ||
"name": "pkg", | ||
"types": "index.d.ts", | ||
"exports": "some-other-thing.js" | ||
} | ||
==== tests/cases/compiler/usage.ts (1 errors) ==== | ||
/// <reference types="pkg" /> | ||
~~~ | ||
!!! error TS2688: Cannot find type definition file for 'pkg'. | ||
|
||
const a: GlobalThing = { a: 0 }; |
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//// [tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts] //// | ||
|
||
//// [index.d.ts] | ||
interface GlobalThing { a: number } | ||
//// [package.json] | ||
{ | ||
"name": "pkg", | ||
"types": "index.d.ts", | ||
"exports": "some-other-thing.js" | ||
} | ||
//// [usage.ts] | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; | ||
|
||
//// [usage.js] | ||
/// <reference types="pkg" /> | ||
const a = { a: 0 }; |
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
=== tests/cases/compiler/node_modules/pkg/index.d.ts === | ||
interface GlobalThing { a: number } | ||
>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) | ||
>a : Symbol(GlobalThing.a, Decl(index.d.ts, 0, 23)) | ||
|
||
=== tests/cases/compiler/usage.ts === | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; | ||
>a : Symbol(a, Decl(usage.ts, 2, 5)) | ||
>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) | ||
>a : Symbol(a, Decl(usage.ts, 2, 24)) | ||
|
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
=== tests/cases/compiler/node_modules/pkg/index.d.ts === | ||
interface GlobalThing { a: number } | ||
>a : number | ||
|
||
=== tests/cases/compiler/usage.ts === | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; | ||
>a : GlobalThing | ||
>{ a: 0 } : { a: number; } | ||
>a : number | ||
>0 : 0 | ||
|
17 changes: 17 additions & 0 deletions
17
...selines/reference/tripleSlashTypesReferenceWithMissingExports(module=nodenext).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
tests/cases/compiler/usage.ts(1,23): error TS2688: Cannot find type definition file for 'pkg'. | ||
|
||
|
||
==== tests/cases/compiler/node_modules/pkg/index.d.ts (0 errors) ==== | ||
interface GlobalThing { a: number } | ||
==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== | ||
{ | ||
"name": "pkg", | ||
"types": "index.d.ts", | ||
"exports": "some-other-thing.js" | ||
} | ||
==== tests/cases/compiler/usage.ts (1 errors) ==== | ||
/// <reference types="pkg" /> | ||
~~~ | ||
!!! error TS2688: Cannot find type definition file for 'pkg'. | ||
|
||
const a: GlobalThing = { a: 0 }; |
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=nodenext).js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//// [tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts] //// | ||
|
||
//// [index.d.ts] | ||
interface GlobalThing { a: number } | ||
//// [package.json] | ||
{ | ||
"name": "pkg", | ||
"types": "index.d.ts", | ||
"exports": "some-other-thing.js" | ||
} | ||
//// [usage.ts] | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; | ||
|
||
//// [usage.js] | ||
/// <reference types="pkg" /> | ||
const a = { a: 0 }; |
13 changes: 13 additions & 0 deletions
13
.../baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=nodenext).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
=== tests/cases/compiler/node_modules/pkg/index.d.ts === | ||
interface GlobalThing { a: number } | ||
>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) | ||
>a : Symbol(GlobalThing.a, Decl(index.d.ts, 0, 23)) | ||
|
||
=== tests/cases/compiler/usage.ts === | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; | ||
>a : Symbol(a, Decl(usage.ts, 2, 5)) | ||
>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) | ||
>a : Symbol(a, Decl(usage.ts, 2, 24)) | ||
|
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=nodenext).types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
=== tests/cases/compiler/node_modules/pkg/index.d.ts === | ||
interface GlobalThing { a: number } | ||
>a : number | ||
|
||
=== tests/cases/compiler/usage.ts === | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; | ||
>a : GlobalThing | ||
>{ a: 0 } : { a: number; } | ||
>a : number | ||
>0 : 0 | ||
|
13 changes: 13 additions & 0 deletions
13
tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// @module: commonjs,node12,nodenext | ||
// @filename: node_modules/pkg/index.d.ts | ||
interface GlobalThing { a: number } | ||
// @filename: node_modules/pkg/package.json | ||
{ | ||
"name": "pkg", | ||
"types": "index.d.ts", | ||
"exports": "some-other-thing.js" | ||
} | ||
// @filename: usage.ts | ||
/// <reference types="pkg" /> | ||
|
||
const a: GlobalThing = { a: 0 }; |