Skip to content

Commit 7039a4d

Browse files
committed
fix: resolve eslint 10 lint errors
1 parent 5baec20 commit 7039a4d

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

src/Line.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,12 @@ const Line: React.FC<ProgressProps> = (props) => {
6565
fillOpacity="0"
6666
/>
6767
{percentList.map((ptg, index) => {
68-
let dashPercent = 1;
69-
switch (strokeLinecap) {
70-
case 'round':
71-
dashPercent = 1 - strokeWidth / 100;
72-
break;
73-
case 'square':
74-
dashPercent = 1 - strokeWidth / 2 / 100;
75-
break;
76-
default:
77-
dashPercent = 1;
78-
break;
79-
}
68+
const dashPercent =
69+
strokeLinecap === 'round'
70+
? 1 - strokeWidth / 100
71+
: strokeLinecap === 'square'
72+
? 1 - strokeWidth / 2 / 100
73+
: 1;
8074
const pathStyle: React.CSSProperties = {
8175
strokeDasharray: `${ptg * dashPercent}px, 100px`,
8276
strokeDashoffset: `-${stackPtg}px`,

0 commit comments

Comments
 (0)