Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Deno 1.4.0 Strict Type Import / Export #1

Closed
asos-craigmorten opened this issue Sep 16, 2020 · 2 comments
Closed

Support Deno 1.4.0 Strict Type Import / Export #1

asos-craigmorten opened this issue Sep 16, 2020 · 2 comments
Assignees

Comments

@asos-craigmorten
Copy link

Describe the bug

Deno 1.4.0 introduced stricter checks on the import and export of types for all users using the --unstable flag. These (presumably) will be integrated with Deno stable in an upcoming release.

This request is to make the necessary changes to support these stricter checks, especially given eta requires the --unstable flag to run and thus is immediately broken by this latest release.

See relevant section in release blog post: https://deno.land/posts/v1.4#stricter-type-checks-in-code--unstablecode

To Reproduce

Import this module in a file and use deno run --unstable to execute the file.

Note there are several errors:

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Priority } from "./types.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/negotiator@1.0.0/src/charset.ts:10:1

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Priority } from "./types.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/negotiator@1.0.0/src/encoding.ts:10:1

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Priority } from "./types.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/negotiator@1.0.0/src/language.ts:10:1

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Priority } from "./types.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/negotiator@1.0.0/src/media_type.ts:10:1

Expected behavior

The import should work without throwing typescript errors relating to type imports and exports.

Package & Environment Details

$ deno --version
deno 1.4.0
v8 8.7.75
typescript 4.0.2

Additional context

Encountered attempting to upgrade Opine to Deno 1.4.0

@ngot
Copy link
Member

ngot commented Sep 16, 2020

Thanks for reporting the issue, will look into it soon.

@ngot
Copy link
Member

ngot commented Sep 16, 2020

fixed at https://deno.land/x/negotiator@1.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants