From 874b1db542ff997639ded10d85772e3aad409517 Mon Sep 17 00:00:00 2001 From: Isabel Duan Date: Mon, 2 Oct 2023 10:16:34 -0700 Subject: [PATCH 1/2] Update isolatedModules.md --- .../tsconfig-reference/copy/en/options/isolatedModules.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/tsconfig-reference/copy/en/options/isolatedModules.md b/packages/tsconfig-reference/copy/en/options/isolatedModules.md index b451b8c20f91..add7baf37dff 100644 --- a/packages/tsconfig-reference/copy/en/options/isolatedModules.md +++ b/packages/tsconfig-reference/copy/en/options/isolatedModules.md @@ -37,12 +37,14 @@ Single-file transpilers don't know whether `someType` produces a value or not, s #### Non-Module Files -If `isolatedModules` is set, all implementation files must be _modules_ (which means it has some form of `import`/`export`). An error occurs if any file isn't a module: +If `isolatedModules` is set, namespaces are only allowed in _modules_ (which means it has some form of `import`/`export`). An error occurs if a namespace is found in a module: ```ts twoslash -// @errors: 1208 +// @errors: 1277 // @isolatedModules -function fn() {} +namespace Instantiated { + export const x = 1; +} ``` This restriction doesn't apply to `.d.ts` files. From d7323ef3b7a4ae4853722d8da1d2791855c52758 Mon Sep 17 00:00:00 2001 From: Isabel Duan Date: Mon, 2 Oct 2023 10:21:32 -0700 Subject: [PATCH 2/2] Update isolatedModules.md --- packages/tsconfig-reference/copy/en/options/isolatedModules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tsconfig-reference/copy/en/options/isolatedModules.md b/packages/tsconfig-reference/copy/en/options/isolatedModules.md index add7baf37dff..a1d4ad5c31f2 100644 --- a/packages/tsconfig-reference/copy/en/options/isolatedModules.md +++ b/packages/tsconfig-reference/copy/en/options/isolatedModules.md @@ -37,7 +37,7 @@ Single-file transpilers don't know whether `someType` produces a value or not, s #### Non-Module Files -If `isolatedModules` is set, namespaces are only allowed in _modules_ (which means it has some form of `import`/`export`). An error occurs if a namespace is found in a module: +If `isolatedModules` is set, namespaces are only allowed in _modules_ (which means it has some form of `import`/`export`). An error occurs if a namespace is found in a non-module file: ```ts twoslash // @errors: 1277