sgwilym / nova-deno

A Deno extension for Nova.
https://extensions.panic.com/extensions/co.gwil/co.gwil.deno/
MIT License
13 stars 1 forks source link

Import module error #29

Closed evamango closed 2 years ago

evamango commented 2 years ago

My project's structure is simple, and I receive an error after import a module. image

How to config the import service?

Also, How to config the formatter/linter, I don't like the semi at the end of line. THX!!

evamango commented 2 years ago

Almost forgot, my Nova version is 9.3. THX!

jaydenseric commented 2 years ago

Write the full path for the module you are importing, i.e:

import foo from "./foo.ts";

Regarding your formatting preferences, that sort of thing is managed in a Deno config file. I don't know if there is an option regarding no semi though, and I suggest you stick to the defaults as much as possible anyway.

sgwilym commented 2 years ago

Hello @evamango!

Deno's a bit different to Node. For example: you don't need a package.json, tsconfig.json, or even node_modules.

Deno also doesn't support what are called bare specifiers, e.g. import { something } from "something". You always need a file extension. Even third party modules are imported this way: import { something } from "https://deno.land/x/something/mod.ts".

You can find out more in the Deno manual.

+1 to wot @jaydenseric says. Also there's no way to configure deno fmt to not use semicolons, though of course there's an open issue.

evamango commented 2 years ago

Thanks a lot!