Skip to content

Conversation

Alfred-Skyblue
Copy link
Member

@Alfred-Skyblue Alfred-Skyblue commented Jun 13, 2023

When we intend to use a value solely as a type, we should import the type using import type instead of importing the value. I have only handled cases where values are used as types, perhaps we should set "importsNotUsedAsValues": "error" to prevent such occurrences?

Copy link
Member

@sxzz sxzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the best approach to maintaining consistency is by implementing an ESLint rule.

@Alfred-Skyblue
Copy link
Member Author

I think the best approach to maintaining consistency is by implementing an ESLint rule.

I added @typescript-eslinteslint-plugin dependency and added ESLint rule

@Alfred-Skyblue Alfred-Skyblue requested a review from sxzz June 14, 2023 03:02
@netlify
Copy link

netlify bot commented Jun 28, 2023

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit c1c87e9
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/649bdb1f19d6d40008e734ed

@netlify
Copy link

netlify bot commented Jun 28, 2023

Deploy Preview for vue-next-template-explorer failed.

Name Link
🔨 Latest commit c1c87e9
🔍 Latest deploy log https://app.netlify.com/sites/vue-next-template-explorer/deploys/649bdb1fbda5b80008109958

@Alfred-Skyblue
Copy link
Member Author

cc @sxzz 👀

@sxzz
Copy link
Member

sxzz commented Aug 13, 2023

Conflicted. Could you please rebase your branch?

@Alfred-Skyblue
Copy link
Member Author

Conflicted. Could you please rebase your branch?

Hi, I have resolved the conflict on the branch

@sxzz sxzz added the ready to merge The PR is ready to be merged. label Aug 14, 2023
@sxzz sxzz force-pushed the chore-import-type branch 2 times, most recently from b457c75 to 1285b32 Compare August 21, 2023 04:24
@sxzz sxzz force-pushed the chore-import-type branch from 1285b32 to 1561338 Compare August 21, 2023 05:17
@github-actions
Copy link

github-actions bot commented Aug 21, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 85.8 kB 32.6 kB 29.5 kB
vue.global.prod.js 132 kB 49.3 kB 44.3 kB

Usages

Name Size Gzip Brotli
createApp 47.9 kB 18.8 kB 17.2 kB
createSSRApp 50.6 kB 19.9 kB 18.2 kB
defineCustomElement 50.3 kB 19.6 kB 17.9 kB
overall 61.2 kB 23.7 kB 21.6 kB

@sxzz sxzz force-pushed the chore-import-type branch from 1561338 to 26b7136 Compare August 21, 2023 05:19
@sxzz
Copy link
Member

sxzz commented Aug 23, 2023

It will create lots of conflicts for other PRs. We need to wait for a time to merge/clean up the PR. Let's put that on hold for now. 😇

@Alfred-Skyblue
Copy link
Member Author

Yes, this PR will cause a large conflict, we should put it to the last merge.

@sxzz sxzz changed the title chore: use import type to import style: prefer import type Sep 7, 2023
@sxzz sxzz changed the base branch from main to chore/style September 7, 2023 13:44
@Alfred-Skyblue
Copy link
Member Author

In PR #8978, the @typescript-eslint/eslint-plugin was added, which can also introduce rules for using import type, and it offers additional features. Therefore, the functionality of this PR will be merged into #8978. We will temporarily close this PR.

cc @sxzz

@Alfred-Skyblue Alfred-Skyblue deleted the chore-import-type branch September 14, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge The PR is ready to be merged. scope: infra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants