From 345f0fbe5cdaa71af067c7072537f1823fe4ada5 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Fri, 10 Dec 2021 09:12:21 +1100 Subject: feat(cli): update to TypeScript 4.5 (#12410) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- cli/tests/testdata/subdir/export_types.ts | 11 +++++++++++ cli/tests/testdata/subdir/import.mts | 4 ++++ cli/tests/testdata/subdir/mod.mjs | 1 + cli/tests/testdata/subdir/types.d.mts | 1 + cli/tests/testdata/subdir/types.d.ts | 1 + 5 files changed, 18 insertions(+) create mode 100644 cli/tests/testdata/subdir/export_types.ts create mode 100644 cli/tests/testdata/subdir/import.mts create mode 100644 cli/tests/testdata/subdir/mod.mjs create mode 100644 cli/tests/testdata/subdir/types.d.mts (limited to 'cli/tests/testdata/subdir') diff --git a/cli/tests/testdata/subdir/export_types.ts b/cli/tests/testdata/subdir/export_types.ts new file mode 100644 index 000000000..18c8ed881 --- /dev/null +++ b/cli/tests/testdata/subdir/export_types.ts @@ -0,0 +1,11 @@ +export interface A { + a: string; +} + +export class B implements A { + a = "a"; +} + +export function create(): B { + return new B(); +} diff --git a/cli/tests/testdata/subdir/import.mts b/cli/tests/testdata/subdir/import.mts new file mode 100644 index 000000000..eeb200f59 --- /dev/null +++ b/cli/tests/testdata/subdir/import.mts @@ -0,0 +1,4 @@ +import * as a from "./mod.mjs"; +import { type A } from "./types.d.mts"; + +console.log(a.a as A); diff --git a/cli/tests/testdata/subdir/mod.mjs b/cli/tests/testdata/subdir/mod.mjs new file mode 100644 index 000000000..9233cce2f --- /dev/null +++ b/cli/tests/testdata/subdir/mod.mjs @@ -0,0 +1 @@ +export const a = "a"; diff --git a/cli/tests/testdata/subdir/types.d.mts b/cli/tests/testdata/subdir/types.d.mts new file mode 100644 index 000000000..28c282146 --- /dev/null +++ b/cli/tests/testdata/subdir/types.d.mts @@ -0,0 +1 @@ +export type A = "a"; diff --git a/cli/tests/testdata/subdir/types.d.ts b/cli/tests/testdata/subdir/types.d.ts index 7f587e144..536a6d0a6 100644 --- a/cli/tests/testdata/subdir/types.d.ts +++ b/cli/tests/testdata/subdir/types.d.ts @@ -1 +1,2 @@ +// deno-lint-ignore-file no-var declare var a: string; -- cgit v1.2.3