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

chore: code style format #994

Merged
merged 3 commits into from
Jun 21, 2024
Merged

chore: code style format #994

merged 3 commits into from
Jun 21, 2024

Conversation

thinkasany
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented Jun 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ant-design-web3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 7:39am

Copy link

changeset-bot bot commented Jun 21, 2024

🦋 Changeset detected

Latest commit: e99b586

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@ant-design/web3-bitcoin Patch
@ant-design/web3-wagmi Patch
@ant-design/web3 Patch
@ant-design/web3-eth-web3js Patch
@ant-design/web3-ethers-v5 Patch
@ant-design/web3-ethers Patch
@example/eth-web3js Patch
@example/ethers-v5 Patch
@example/ethers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

github-actions bot commented Jun 21, 2024

Preview is ready

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (868e6fc) to head (e99b586).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #994   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          720       720           
  Lines        22210     22210           
  Branches      1287      1287           
=========================================
  Hits         22210     22210           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -1,5 +1,6 @@
import React from 'react';
import { ConnectModal, ConnectModalProps } from '@ant-design/web3';
import type { ConnectModalProps } from '@ant-design/web3';
import { ConnectModal } from '@ant-design/web3';
Copy link
Collaborator

Choose a reason for hiding this comment

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

这块要讨论下,目前项目里有两种写法:

// 第一种
import { Foo, type Bar } from 'xxx';

// 第二种
import { Foo } from 'xxx';
import type { Bar } from 'xxx';

从语法上来说,第一种被 tsc 支持的时间更晚,但看起来会更简单,大家什么看法呢

Copy link
Collaborator

Choose a reason for hiding this comment

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

感觉都可以,一般如果 type 比较多就用第二种,如果只有一两个就用第一种,感觉写的时怎么简洁怎么来,不用来纠结

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

第二种写法的优点是更清晰,明确地区分了值导入和类型导入。这可以使你的代码更易于理解,特别是对于那些不熟悉 TypeScript 的开发者, 所以在用于demo的时候好像第二种更好。

不过其实确实不用关心这一块,我是运行插件命令 eslint fix, 推荐我用2写法 然后统一修复的。

@@ -1,6 +1,6 @@
import type { Wallet, WalletMetadata } from '@ant-design/web3-common';
Copy link
Collaborator

Choose a reason for hiding this comment

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

这种也需要 changelog 的,不然发不出版本

@thinkasany thinkasany merged commit 3727e20 into main Jun 21, 2024
12 checks passed
@thinkasany thinkasany deleted the fix-eslint branch June 21, 2024 07:54
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

Successfully merging this pull request may close these issues.

3 participants