Loading...

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

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


A common error when starting out coding with Deno is this annoying a warning 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)

error

To get around this is pretty easy easy.

1. Install Deno extensions

VSCODE-DENO

2. Enable deno.lint

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

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:

success