-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10340 from Microsoft/lower_case_types
Use lowercase names for type reference directives
- Loading branch information
Showing
6 changed files
with
67 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
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/conformance/typings/typingsLookup3.ts] //// | ||
|
||
//// [index.d.ts] | ||
declare var $: { x: any }; | ||
|
||
//// [a.ts] | ||
/// <reference types="JqUeRy" /> | ||
$.x; | ||
|
||
|
||
//// [a.js] | ||
/// <reference types="JqUeRy" /> | ||
$.x; |
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,12 @@ | ||
=== /a.ts === | ||
/// <reference types="JqUeRy" /> | ||
$.x; | ||
>$.x : Symbol(x, Decl(index.d.ts, 0, 16)) | ||
>$ : Symbol($, Decl(index.d.ts, 0, 11)) | ||
>x : Symbol(x, Decl(index.d.ts, 0, 16)) | ||
|
||
=== /node_modules/@types/jquery/index.d.ts === | ||
declare var $: { x: any }; | ||
>$ : Symbol($, Decl(index.d.ts, 0, 11)) | ||
>x : Symbol(x, Decl(index.d.ts, 0, 16)) | ||
|
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,12 @@ | ||
[ | ||
"======== Resolving type reference directive 'jquery', containing file '/a.ts', root directory '/node_modules/@types'. ========", | ||
"Resolving with primary search path '/node_modules/@types'", | ||
"File '/node_modules/@types/jquery/package.json' does not exist.", | ||
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.", | ||
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========", | ||
"======== Resolving type reference directive 'jquery', containing file '/__inferred type names__.ts', root directory '/node_modules/@types'. ========", | ||
"Resolving with primary search path '/node_modules/@types'", | ||
"File '/node_modules/@types/jquery/package.json' does not exist.", | ||
"File '/node_modules/@types/jquery/index.d.ts' exist - use it as a name resolution result.", | ||
"======== Type reference directive 'jquery' was successfully resolved to '/node_modules/@types/jquery/index.d.ts', primary: true. ========" | ||
] |
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,12 @@ | ||
=== /a.ts === | ||
/// <reference types="JqUeRy" /> | ||
$.x; | ||
>$.x : any | ||
>$ : { x: any; } | ||
>x : any | ||
|
||
=== /node_modules/@types/jquery/index.d.ts === | ||
declare var $: { x: any }; | ||
>$ : { x: any; } | ||
>x : any | ||
|
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 @@ | ||
// @traceResolution: true | ||
// @noImplicitReferences: true | ||
// @currentDirectory: / | ||
// This tests that `types` references are automatically lowercased. | ||
|
||
// @filename: /tsconfig.json | ||
{ "files": "a.ts" } | ||
|
||
// @filename: /node_modules/@types/jquery/index.d.ts | ||
declare var $: { x: any }; | ||
|
||
// @filename: /a.ts | ||
/// <reference types="JqUeRy" /> | ||
$.x; |