-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing isolatedModules error for
export import
(#47838)
* Add missing isolatedModules error for `export import` * Update existing baseline
- Loading branch information
1 parent
954d044
commit 0655f32
Showing
6 changed files
with
93 additions
and
2 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
25 changes: 25 additions & 0 deletions
25
tests/baselines/reference/isolatedModulesExportImportUninstantiatedNamespace.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,25 @@ | ||
tests/cases/compiler/factory.ts(3,1): error TS1269: Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided. | ||
|
||
|
||
==== tests/cases/compiler/jsx.ts (0 errors) ==== | ||
export namespace JSXInternal { | ||
export type HTMLAttributes = string | ||
export type ComponentChildren = string | ||
} | ||
|
||
==== tests/cases/compiler/factory.ts (1 errors) ==== | ||
import { JSXInternal } from "./jsx" | ||
|
||
export import JSX = JSXInternal; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS1269: Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided. | ||
|
||
export function createElement<ElementType extends HTMLElement>( | ||
tagName: string, | ||
attributes: JSX.HTMLAttributes, | ||
...children: JSX.ComponentChildren[] | ||
): any { | ||
//... | ||
} | ||
|
||
|
33 changes: 33 additions & 0 deletions
33
tests/baselines/reference/isolatedModulesExportImportUninstantiatedNamespace.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,33 @@ | ||
//// [tests/cases/compiler/isolatedModulesExportImportUninstantiatedNamespace.ts] //// | ||
|
||
//// [jsx.ts] | ||
export namespace JSXInternal { | ||
export type HTMLAttributes = string | ||
export type ComponentChildren = string | ||
} | ||
|
||
//// [factory.ts] | ||
import { JSXInternal } from "./jsx" | ||
|
||
export import JSX = JSXInternal; | ||
|
||
export function createElement<ElementType extends HTMLElement>( | ||
tagName: string, | ||
attributes: JSX.HTMLAttributes, | ||
...children: JSX.ComponentChildren[] | ||
): any { | ||
//... | ||
} | ||
|
||
|
||
|
||
//// [jsx.js] | ||
export {}; | ||
//// [factory.js] | ||
export function createElement(tagName, attributes) { | ||
var children = []; | ||
for (var _i = 2; _i < arguments.length; _i++) { | ||
children[_i - 2] = arguments[_i]; | ||
} | ||
//... | ||
} |
5 changes: 4 additions & 1 deletion
5
tests/baselines/reference/isolatedModulesReExportType.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
23 changes: 23 additions & 0 deletions
23
tests/cases/compiler/isolatedModulesExportImportUninstantiatedNamespace.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,23 @@ | ||
// @module: esnext | ||
// @isolatedModules: true | ||
// @noTypesAndSymbols: true | ||
|
||
// @Filename: jsx.ts | ||
export namespace JSXInternal { | ||
export type HTMLAttributes = string | ||
export type ComponentChildren = string | ||
} | ||
|
||
// @Filename: factory.ts | ||
import { JSXInternal } from "./jsx" | ||
|
||
export import JSX = JSXInternal; | ||
|
||
export function createElement<ElementType extends HTMLElement>( | ||
tagName: string, | ||
attributes: JSX.HTMLAttributes, | ||
...children: JSX.ComponentChildren[] | ||
): any { | ||
//... | ||
} | ||
|