diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-14 11:58:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-14 11:58:47 +0100 |
| commit | af2d992ecd2b9320072164b6ee295c31a3194406 (patch) | |
| tree | 0926e2852aa2c4eb300e1f54f4c84d7568589b3b /tests/specs/check/export_equals_declaration_file | |
| parent | 2c0bf6fd65b3276c4818c73028b19819608c8e70 (diff) | |
feat: TypeScript 5.6 and `npm:@types/node@22` (#25614)
Diffstat (limited to 'tests/specs/check/export_equals_declaration_file')
5 files changed, 34 insertions, 0 deletions
diff --git a/tests/specs/check/export_equals_declaration_file/__test__.jsonc b/tests/specs/check/export_equals_declaration_file/__test__.jsonc new file mode 100644 index 000000000..d69543a47 --- /dev/null +++ b/tests/specs/check/export_equals_declaration_file/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "steps": [{ + "args": "check main.ts", + "output": "main.out" + }, { + // ensure diagnostic is not cached + "args": "check main.ts", + "output": "main.out" + }] +} diff --git a/tests/specs/check/export_equals_declaration_file/main.out b/tests/specs/check/export_equals_declaration_file/main.out new file mode 100644 index 000000000..70b7d2fe6 --- /dev/null +++ b/tests/specs/check/export_equals_declaration_file/main.out @@ -0,0 +1,6 @@ +Check file:///[WILDLINE]/main.ts +TS1203 [WARN]: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. This will start erroring in a future version of Deno 2 in order to align with TypeScript. +export = other; +~~~~~~~~~~~~~~~ + at file:///[WILDLINE]/other.d.ts:1:1 + diff --git a/tests/specs/check/export_equals_declaration_file/main.ts b/tests/specs/check/export_equals_declaration_file/main.ts new file mode 100644 index 000000000..e20a735d5 --- /dev/null +++ b/tests/specs/check/export_equals_declaration_file/main.ts @@ -0,0 +1,6 @@ +// @deno-types="./other.d.ts" +import Test, { type Attributes } from "./other.js"; + +const other: Attributes = {}; +console.log(Test()); +console.log(other); diff --git a/tests/specs/check/export_equals_declaration_file/other.d.ts b/tests/specs/check/export_equals_declaration_file/other.d.ts new file mode 100644 index 000000000..5e1274fa5 --- /dev/null +++ b/tests/specs/check/export_equals_declaration_file/other.d.ts @@ -0,0 +1,9 @@ +export = other; + +declare function other(): string; + +declare namespace other { + interface Attributes { + [attr: string]: string; + } +} diff --git a/tests/specs/check/export_equals_declaration_file/other.js b/tests/specs/check/export_equals_declaration_file/other.js new file mode 100644 index 000000000..f66c03162 --- /dev/null +++ b/tests/specs/check/export_equals_declaration_file/other.js @@ -0,0 +1,3 @@ +export default function other() { + return "test"; +} |
