Skip to content

Commit bfd65b7

Browse files
Boshenclaude
andcommitted
feat: enable type-aware linting and fix tooltip formatter types
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d8d288c commit bfd65b7

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

apps/dashboard/vite.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import { defineConfig } from "vite-plus";
66
export default defineConfig({
77
plugins: [tailwindcss()],
88
base: "/vibe-dashboard/",
9-
experimental: {
10-
enableNativePlugin: true,
11-
},
129
build: {
1310
rolldownOptions: {
1411
output: {

packages/utils/src/rolldown-formatters.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,18 @@ export const formatDate = (dateString: string): string => {
1010
});
1111
};
1212

13-
export const bundleSizeDiffTooltipFormatter = (value: any, name: string, props: any) => {
14-
const data = props.payload;
15-
if (!data) return [value, name];
13+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- recharts Formatter type uses `any` for payload
14+
type TooltipFormatter = (
15+
value: any,
16+
name: any,
17+
item: any,
18+
index: number,
19+
payload: any,
20+
) => [string, string];
21+
22+
export const bundleSizeDiffTooltipFormatter: TooltipFormatter = (value, _name, item) => {
23+
const data = item.payload;
24+
if (!data) return [String(value), ""];
1625

1726
const publicationDateText = data.publicationDate
1827
? ` | Published: ${formatDate(data.publicationDate)}`
@@ -32,9 +41,9 @@ export const bundleSizeDiffTooltipFormatter = (value: any, name: string, props:
3241
return [`${changeText} ${fromTo}${publicationDateText}`, "Size Change"];
3342
};
3443

35-
export const buildTimeTooltipFormatter = (value: any, name: string, props: any) => {
36-
const data = props.payload;
37-
if (!data) return [value, name];
44+
export const buildTimeTooltipFormatter: TooltipFormatter = (value, _name, item) => {
45+
const data = item.payload;
46+
if (!data) return [String(value), ""];
3847

3948
const publicationDateText = data.publicationDate
4049
? ` | Published: ${formatDate(data.publicationDate)}`

vite.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ export default defineConfig({
1717
"import/no-unassigned-import": ["error", { allow: ["**/*.css"] }],
1818
},
1919
ignorePatterns: ["dist"],
20+
options: {
21+
typeCheck: true,
22+
typeAware: true,
23+
},
2024
},
2125
test: {
2226
projects: ["apps/dashboard"],

0 commit comments

Comments
 (0)