forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix import type resolution in jsdoc, mark 2 (microsoft#35057)
Fake alias resolution only applies when the import type is followed by a qualified name. Otherwise the alias is sufficiently resolved already.
- Loading branch information
Showing
7 changed files
with
103 additions
and
1 deletion.
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
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/jsdocImportTypeReferenceToCommonjsModule.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,22 @@ | ||
=== tests/cases/conformance/jsdoc/ex.d.ts === | ||
declare var config: { | ||
>config : Symbol(config, Decl(ex.d.ts, 0, 11)) | ||
|
||
fix: boolean | ||
>fix : Symbol(fix, Decl(ex.d.ts, 0, 21)) | ||
} | ||
export = config; | ||
>config : Symbol(config, Decl(ex.d.ts, 0, 11)) | ||
|
||
=== tests/cases/conformance/jsdoc/test.js === | ||
/** @param {import('./ex')} a */ | ||
function demo(a) { | ||
>demo : Symbol(demo, Decl(test.js, 0, 0)) | ||
>a : Symbol(a, Decl(test.js, 1, 14)) | ||
|
||
a.fix | ||
>a.fix : Symbol(fix, Decl(ex.d.ts, 0, 21)) | ||
>a : Symbol(a, Decl(test.js, 1, 14)) | ||
>fix : Symbol(fix, Decl(ex.d.ts, 0, 21)) | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/jsdocImportTypeReferenceToCommonjsModule.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,22 @@ | ||
=== tests/cases/conformance/jsdoc/ex.d.ts === | ||
declare var config: { | ||
>config : { fix: boolean; } | ||
|
||
fix: boolean | ||
>fix : boolean | ||
} | ||
export = config; | ||
>config : { fix: boolean; } | ||
|
||
=== tests/cases/conformance/jsdoc/test.js === | ||
/** @param {import('./ex')} a */ | ||
function demo(a) { | ||
>demo : (a: { fix: boolean; }) => void | ||
>a : { fix: boolean; } | ||
|
||
a.fix | ||
>a.fix : boolean | ||
>a : { fix: boolean; } | ||
>fix : boolean | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/jsdocImportTypeReferenceToESModule.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,16 @@ | ||
=== tests/cases/conformance/jsdoc/ex.d.ts === | ||
export var config: {} | ||
>config : Symbol(config, Decl(ex.d.ts, 0, 10)) | ||
|
||
=== tests/cases/conformance/jsdoc/test.js === | ||
/** @param {import('./ex')} a */ | ||
function demo(a) { | ||
>demo : Symbol(demo, Decl(test.js, 0, 0)) | ||
>a : Symbol(a, Decl(test.js, 1, 14)) | ||
|
||
a.config | ||
>a.config : Symbol(config, Decl(ex.d.ts, 0, 10)) | ||
>a : Symbol(a, Decl(test.js, 1, 14)) | ||
>config : Symbol(config, Decl(ex.d.ts, 0, 10)) | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/jsdocImportTypeReferenceToESModule.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,16 @@ | ||
=== tests/cases/conformance/jsdoc/ex.d.ts === | ||
export var config: {} | ||
>config : {} | ||
|
||
=== tests/cases/conformance/jsdoc/test.js === | ||
/** @param {import('./ex')} a */ | ||
function demo(a) { | ||
>demo : (a: typeof import("tests/cases/conformance/jsdoc/ex")) => void | ||
>a : typeof import("tests/cases/conformance/jsdoc/ex") | ||
|
||
a.config | ||
>a.config : {} | ||
>a : typeof import("tests/cases/conformance/jsdoc/ex") | ||
>config : {} | ||
} | ||
|
14 changes: 14 additions & 0 deletions
14
tests/cases/conformance/jsdoc/jsdocImportTypeReferenceToCommonjsModule.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,14 @@ | ||
// @noEmit: true | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @Filename: ex.d.ts | ||
declare var config: { | ||
fix: boolean | ||
} | ||
export = config; | ||
|
||
// @Filename: test.js | ||
/** @param {import('./ex')} a */ | ||
function demo(a) { | ||
a.fix | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/cases/conformance/jsdoc/jsdocImportTypeReferenceToESModule.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,11 @@ | ||
// @noEmit: true | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @Filename: ex.d.ts | ||
export var config: {} | ||
|
||
// @Filename: test.js | ||
/** @param {import('./ex')} a */ | ||
function demo(a) { | ||
a.config | ||
} |