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

Add a more eye-catching indicator #117

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lingengyan
Copy link

@lingengyan lingengyan commented Jun 3, 2021

Add a feature for ant-design.
The ID of issue is ant-design/ant-design#30596.
Please check, thanks a lot.

@vercel
Copy link

vercel bot commented Jun 3, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/progress/8kiPhRrh3mrwVpyvAnrPBP5ZP6uK
✅ Preview: https://progress-git-fork-lingengyan-dot-react-component.vercel.app

src/interface.ts Outdated
}

export type StrokeColorType = string | string[] | object;

export type GapPositionType = 'top' | 'right' | 'bottom' | 'left';

export type StrokeLinecapType = 'round' | 'butt' | 'square';

export type dotType = boolean | object;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export type dotType = boolean | object;
export type DotType = boolean | object;

Copy link
Member

Choose a reason for hiding this comment

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

object .size等的类型明确出来

@@ -80,6 +84,7 @@ class Example extends React.Component<ProgressProps, any> {
strokeWidth={6}
strokeLinecap="square"
strokeColor={color}
dot={{ size: [] }}
Copy link
Member

Choose a reason for hiding this comment

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

lint 应该会报错吧?

Copy link
Author

Choose a reason for hiding this comment

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

没有哦,lint不通过好像都没法提交commit,lint只有两个warning在我没改过的代码那边

Copy link
Author

Choose a reason for hiding this comment

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

PS C:\Users\xxx\progress> npm run lint

rc-progress@3.1.4 lint
eslint src/ --ext .ts,.tsx,.jsx,.js

C:\Users\xxx\progress\src\Line.tsx
4:1 warning All imports in the declaration are only used as types. Use import type @typescript-eslint/consistent-type-imports

C:\Users\xxx\progress\src\interface.ts
19:51 warning Don't use object as a type. The object type is currently hard to use (see this issue).
Consider using Record<string, unknown> instead, as it allows you to more easily inspect and use the keys @typescript-eslint/ban-types

✖ 2 problems (0 errors, 2 warnings)
0 errors and 1 warning potentially fixable with the --fix option.

以上是lint的执行结果,所以那两个错误参数的情况要去掉嘛

Copy link
Member

Choose a reason for hiding this comment

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

按正常写,不用写错误的demo;
但代码还是应该为非ts场景判断size为number;
添加用例;

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.

2 participants