Skip to content

Commit 8c2d2d4

Browse files
committed
Add lint, test, and type-check scripts to plugins
Added 'lint', 'test', and 'type-check' scripts to package.json files for designer, plugin-charts, plugin-editor, plugin-kanban, and plugin-markdown packages to standardize development workflows. Refactored ChartContainerImpl.tsx for improved type safety and className handling. Removed 'Studio' link from docs navigation.
1 parent eb3d7da commit 8c2d2d4

7 files changed

Lines changed: 29 additions & 18 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export default defineConfig({
1313

1414
nav: [
1515
{ text: 'Home', link: '/' },
16-
{ text: 'Studio', link: '/studio/', target: '_self' },
1716
{ text: 'Guide', link: '/guide/introduction' },
1817
{
1918
text: 'Documentation',

packages/designer/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"scripts": {
1010
"build": "tsc",
1111
"test": "vitest run",
12-
"test:watch": "vitest"
12+
"test:watch": "vitest",
13+
"type-check": "tsc --noEmit",
14+
"lint": "eslint ."
1315
},
1416
"peerDependencies": {
1517
"react": "^18.3.1",

packages/plugin-charts/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
}
1515
},
1616
"scripts": {
17-
"build": "vite build"
17+
"build": "vite build",
18+
"test": "vitest run",
19+
"type-check": "tsc --noEmit",
20+
"lint": "eslint ."
1821
},
1922
"dependencies": {
2023
"recharts": "^3.6.0",

packages/plugin-charts/src/ChartContainerImpl.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ function ChartTooltipContent({
174174
{!nestLabel ? tooltipLabel : null}
175175
<div className="grid gap-1.5">
176176
{payload
177-
.filter((item) => item.type !== "none")
178-
.map((item, index) => {
177+
.filter((item: any) => item.type !== "none")
178+
.map((item: any, index: number) => {
179179
const key = `${nameKey || item.name || item.dataKey || "value"}`
180180
const itemConfig = getPayloadConfigFromPayload(config, item, key)
181181
const indicatorColor = color || item.payload.fill || item.color
@@ -185,7 +185,7 @@ function ChartTooltipContent({
185185
key={item.dataKey}
186186
className={cn(
187187
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
188-
indicator === "dot" && "items-center"
188+
indicator === "dot" ? "items-center" : ""
189189
)}
190190
>
191191
{formatter && item?.value !== undefined && item.name ? (
@@ -199,15 +199,13 @@ function ChartTooltipContent({
199199
<div
200200
className={cn(
201201
"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
202-
{
203-
"h-2.5 w-2.5": indicator === "dot",
204-
"w-1": indicator === "line",
205-
"w-0 border-[1.5px] border-dashed bg-transparent":
206-
indicator === "dashed",
207-
"my-0.5": nestLabel && indicator === "dashed",
208-
}
202+
indicator === "dot" ? "h-2.5 w-2.5" : "",
203+
indicator === "line" ? "w-1" : "",
204+
indicator === "dashed" ? "w-0 border-[1.5px] border-dashed bg-transparent" : "",
205+
(nestLabel && indicator === "dashed") ? "my-0.5" : "",
209206
)}
210207
style={
208+
211209
{
212210
"--color-bg": indicatorColor,
213211
"--color-border": indicatorColor,
@@ -268,8 +266,8 @@ function ChartLegendContent({
268266
)}
269267
>
270268
{payload
271-
.filter((item) => item.type !== "none")
272-
.map((item) => {
269+
.filter((item: any) => item.type !== "none")
270+
.map((item: any) => {
273271
const key = `${nameKey || item.dataKey || "value"}`
274272
const itemConfig = getPayloadConfigFromPayload(config, item, key)
275273

packages/plugin-editor/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
}
1515
},
1616
"scripts": {
17-
"build": "vite build"
17+
"build": "vite build",
18+
"test": "vitest run",
19+
"type-check": "tsc --noEmit",
20+
"lint": "eslint ."
1821
},
1922
"dependencies": {
2023
"@monaco-editor/react": "^4.6.0",

packages/plugin-kanban/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
}
1515
},
1616
"scripts": {
17-
"build": "vite build"
17+
"build": "vite build",
18+
"test": "vitest run",
19+
"type-check": "tsc --noEmit",
20+
"lint": "eslint ."
1821
},
1922
"dependencies": {
2023
"@dnd-kit/core": "^6.3.1",

packages/plugin-markdown/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
}
1515
},
1616
"scripts": {
17-
"build": "vite build"
17+
"build": "vite build",
18+
"test": "vitest run",
19+
"type-check": "tsc --noEmit",
20+
"lint": "eslint ."
1821
},
1922
"dependencies": {
2023
"react-markdown": "^10.1.0",

0 commit comments

Comments
 (0)