-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: deno-types directive should have higher precedence than X-TypeSc…
…ript-Types header (#6761)
- Loading branch information
1 parent
f162ced
commit b45f9a7
Showing
5 changed files
with
72 additions
and
6 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
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 @@ | ||
/** | ||
* Following import uses two distinct ways to provide types: | ||
* - X-TypeScript-Types headers | ||
* - @deno-types directive | ||
* | ||
* Because "@deno-types" directive must be placed by user explicitly it | ||
* should have higher precedence than type header. | ||
* | ||
* This is verified by providing conflicting type declaration | ||
* depending on a way. There should be no TS error, otherwise | ||
* it means that wrong type declarations are used (from X-TypeScript-Types) | ||
* header. | ||
*/ | ||
|
||
// @deno-types="http://127.0.0.1:4545/type_headers_deno_types.foo.d.ts" | ||
import { foo } from "http://127.0.0.1:4545/type_headers_deno_types.foo.js"; | ||
|
||
foo("hello"); |
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,5 @@ | ||
Download http://[WILDCARD]:4545/type_headers_deno_types.foo.js | ||
Download http://[WILDCARD]:4545/type_headers_deno_types.foo.d.ts | ||
Download http://[WILDCARD]:4545/type_headers_deno_types.d.ts | ||
Check [WILDCARD]/type_headers_deno_types.ts | ||
hello |
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
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