From 2fa213717295687542269bcaf99970177bc01fba Mon Sep 17 00:00:00 2001 From: Greg Hurrell Date: Wed, 18 Mar 2020 21:14:57 +0100 Subject: [PATCH] refactor: show that imports aren't working well Sadly, we can't do imports without TS screaming bloody murder in Vim: An import path cannot end with a '.d.ts' extension etc Related: https://github.com/Microsoft/TypeScript/issues/27481 We can suppress the error, but either way, the editor can't see the types, sadly obviating one of the big upsides of using TypeScript. --- lib/main.ts | 6 +++++- lib/other.ts | 3 +++ tsconfig.json | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 lib/other.ts diff --git a/lib/main.ts b/lib/main.ts index c2aebde15..4890837d8 100644 --- a/lib/main.ts +++ b/lib/main.ts @@ -1,4 +1,8 @@ // This is only for the benefit of the LanguageClient. +// @ts-ignore import type Deno from '../vendor/deno/types.d.ts'; -console.log(Deno.args); +// @ts-ignore +import test from './other.ts'; + +test(Deno.args); diff --git a/lib/other.ts b/lib/other.ts new file mode 100644 index 000000000..247226c62 --- /dev/null +++ b/lib/other.ts @@ -0,0 +1,3 @@ +export default function(args: Array) { + console.log(...args); +} diff --git a/tsconfig.json b/tsconfig.json index e69de29bb..e1529ad3c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -0,0 +1,3 @@ +{ + "include": ["src/**/*.ts", "vendor/deno/types.d.ts"] +}