Skip to content

Commit 02789bf

Browse files
committed
fix(lint): clean up biome errors from icon migration
- Remove unused React imports from GuidedSetupCard and PromoCard - Sort imports alphabetically in DocCard and ChallengeGrid - Remove stale biome-ignore suppression comments in CSS files
1 parent fbb2309 commit 02789bf

4 files changed

Lines changed: 32 additions & 33 deletions

File tree

crowdsec-docs/src/components/docs/ChallengeGrid/index.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { CIcon } from "@coreui/icons-react";
21
import {
3-
cilSearch,
42
cilBarChart,
5-
cilLayers,
6-
cilShieldAlt,
3+
cilBell,
74
cilCompass,
8-
cilSpeedometer,
95
cilGlobeAlt,
6+
cilLayers,
107
cilLockLocked,
11-
cilBell,
128
cilRss,
9+
cilSearch,
10+
cilShieldAlt,
11+
cilSpeedometer,
1312
} from "@coreui/icons";
13+
import { CIcon } from "@coreui/icons-react";
1414
import React from "react";
1515

1616
const CUI: Record<string, object> = {
@@ -49,9 +49,11 @@ export default function ChallengeGrid({ challenges }: Props) {
4949
}}
5050
>
5151
{challenges.map((c, i) => {
52-
const iconEl = c.icon ?? (c.iconName && CUI[c.iconName] ? (
53-
<CIcon icon={CUI[c.iconName] as Parameters<typeof CIcon>[0]["icon"]} aria-hidden="true" />
54-
) : null);
52+
const iconEl =
53+
c.icon ??
54+
(c.iconName && CUI[c.iconName] ? (
55+
<CIcon icon={CUI[c.iconName] as Parameters<typeof CIcon>[0]["icon"]} aria-hidden="true" />
56+
) : null);
5557
return (
5658
<div
5759
// biome-ignore lint/suspicious/noArrayIndexKey: challenges have no stable id

crowdsec-docs/src/components/docs/DocCard/index.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
import { CIcon } from "@coreui/icons-react";
21
import {
3-
cilSearch,
4-
cilLockLocked,
5-
cilTerminal,
6-
cilGlobeAlt,
7-
cilShieldAlt,
8-
cilRss,
9-
cilCompass,
10-
cilBook,
11-
cilPuzzle,
12-
cilWarning,
13-
cilSpeedometer,
2+
cilArrowRight,
3+
cilBarChart,
144
cilBell,
5+
cilBook,
6+
cilBriefcase,
157
cilCheckCircle,
16-
cilBarChart,
17-
cilPeople,
188
cilCode,
19-
cilLayers,
20-
cilStar,
9+
cilCompass,
10+
cilGlobeAlt,
2111
cilInfo,
12+
cilLayers,
13+
cilLockLocked,
2214
cilNotes,
23-
cilBriefcase,
24-
cilArrowRight,
15+
cilPeople,
16+
cilPuzzle,
17+
cilRss,
18+
cilSearch,
19+
cilShieldAlt,
20+
cilSpeedometer,
21+
cilStar,
22+
cilTerminal,
23+
cilWarning,
2524
} from "@coreui/icons";
25+
import { CIcon } from "@coreui/icons-react";
2626
import React from "react";
2727

2828
/* Shared icon set — use CoreUI icons throughout */

crowdsec-docs/src/components/docs/GuidedSetupCard/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
import { cilBolt, cilCompass } from "@coreui/icons";
12
import { CIcon } from "@coreui/icons-react";
2-
import { cilCompass, cilBolt } from "@coreui/icons";
3-
import React from "react";
43

54
type Cta = { label: string; href: string };
65

crowdsec-docs/src/components/docs/PromoCard/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
import { cilArrowRight, cilBell, cilGlobeAlt, cilRss, cilShieldAlt, cilSpeedometer } from "@coreui/icons";
12
import { CIcon } from "@coreui/icons-react";
2-
import { cilRss, cilBell, cilSpeedometer, cilGlobeAlt, cilShieldAlt, cilArrowRight } from "@coreui/icons";
3-
import React from "react";
43
import styles from "./index.module.css";
54

65
export type PromoVariant = "console" | "cti" | "engine";
@@ -115,8 +114,7 @@ export default function PromoCard({ variant = "console" }: Props) {
115114
))}
116115
</div>
117116
<a href={data.ctaHref} className={styles.cta} style={{ background: data.color, color: "var(--cs-btn-text)" }}>
118-
{data.ctaLabel}{" "}
119-
<CIcon icon={cilArrowRight} style={{ width: 13, height: 13 }} aria-hidden="true" />
117+
{data.ctaLabel} <CIcon icon={cilArrowRight} style={{ width: 13, height: 13 }} aria-hidden="true" />
120118
</a>
121119
</div>
122120
</div>

0 commit comments

Comments
 (0)