Deno avoid import path cannot end with a .ts extension error in vscode warning

M Ferreira
M Ferreira

A common error when starting out coding with Deno is this annoying awarning about not being allowed to import using file extentions.

An import path cannot end with a '.ts' extension. Consider importing './data/plays.js' instead.ts(2691)


To get around this is pretty easy easy.

1. Install Deno extensions


2. Enable deno.lint

Type CTRl+, to bring up the settings panel and search for deno.lint.


This will create a settings.json file in your .vscode folder.

3. Next add some configurations.

They are:

{ "deno.enable": true, "deno.lint": true }

4. Success

Jobs done: