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

[ERROR]: This import is never used as a value and must use 'import type' #2

Closed
hu-qi opened this issue Nov 28, 2020 · 2 comments
Closed

Comments

@hu-qi
Copy link
Contributor

hu-qi commented Nov 28, 2020

可能需要在import 类型的时候添加type关键字。
本地运行

deno run --unstable --allow-net --allow-read --allow-write --importmap=import_map.json mod.ts

报错:

error: TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { SearchWord } from "./types.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at file:///Users/gpdi/Documents/huqi/deno/jjc/zhihu-trending-top-search/utils.ts:1:1

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { SearchWord, TopSearch } from "./types.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at file:///Users/gpdi/Documents/huqi/deno/jjc/zhihu-trending-top-search/mod.ts:7:1

@hu-qi
Copy link
Contributor Author

hu-qi commented Nov 28, 2020

可能又是版本的问题

@hu-qi hu-qi closed this as completed Nov 28, 2020
@hu-qi hu-qi reopened this Nov 28, 2020
@hu-qi hu-qi closed this as completed Nov 28, 2020
@hu-qi
Copy link
Contributor Author

hu-qi commented Nov 28, 2020

找着了:https://deno.land/posts/v1.5#stricter-type-checks-in-stable

我厚着脸皮刷个pr

@hu-qi hu-qi reopened this Nov 28, 2020
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

1 participant