Skip to content

Commit cdf3fdc

Browse files
authored
refactor(report): add typecheck for all apps (#1019)
* refactor(report): add typecheck for all apps * chore(report): remove unused hoverMaskColor variable and clean up pnpm-lock.yaml
1 parent b3b21ea commit cdf3fdc

File tree

16 files changed

+36
-42
lines changed

16 files changed

+36
-42
lines changed

apps/android-playground/rsbuild.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { pluginLess } from '@rsbuild/plugin-less';
55
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
66
import { pluginReact } from '@rsbuild/plugin-react';
77
import { pluginSvgr } from '@rsbuild/plugin-svgr';
8+
import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
89

910
const copyAndroidPlaygroundStatic = () => ({
1011
name: 'copy-android-playground-static',
@@ -71,5 +72,6 @@ export default defineConfig({
7172
pluginLess(),
7273
pluginSvgr(),
7374
copyAndroidPlaygroundStatic(),
75+
pluginTypeCheck(),
7476
],
7577
});

apps/android-playground/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default function App() {
8484
socket.emit('get-devices');
8585
});
8686

87-
socket.on('disconnect', (reason: string) => {
87+
socket.on('disconnect', (_reason: string) => {
8888
setLoadingDevices(true);
8989
});
9090

apps/android-playground/src/adb-device/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface AdbDeviceProps {
3636

3737
const AdbDevice: React.FC<AdbDeviceProps> = ({
3838
devices,
39-
loadingDevices,
39+
loadingDevices: _loadingDevices,
4040
selectedDeviceId,
4141
onDeviceSelect,
4242
socketRef,

apps/android-playground/src/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import ReactDOM from 'react-dom/client';
32
import App from './App';
43

apps/android-playground/src/scrcpy-player/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export const ScrcpyPlayer = forwardRef<ScrcpyRefMethods, ScrcpyProps>(
209209
};
210210

211211
// setup video stream processing
212-
const setupVideoStream = (metadata: VideoMetadata) => {
212+
const setupVideoStream = (_metadata: VideoMetadata) => {
213213
// for tracking if the configuration frame has been received
214214
let configurationPacketSent = false;
215215
let pendingDataPackets: any[] = [];

apps/chrome-extension/rsbuild.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ export default defineConfig({
9090
pluginNodePolyfill(),
9191
pluginLess(),
9292
pluginSvgr(),
93-
// pluginTypeCheck({
94-
// // Enable type checking for both development and production builds
95-
// enable: true,
96-
// }),
93+
pluginTypeCheck(),
9794
],
9895
});

apps/chrome-extension/src/extension/bridge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export default function Bridge() {
126126
const loadMessages = async () => {
127127
try {
128128
const messages = await getBridgeMsgsFromStorage();
129-
setMessageList(messages);
129+
setMessageList(messages as BridgeMessageItem[]);
130130
} catch (error) {
131131
console.error('Failed to load bridge messages from storage:', error);
132132
}

apps/recorder-form/rsbuild.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { defineConfig } from '@rsbuild/core';
22
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
33
import { pluginReact } from '@rsbuild/plugin-react';
4+
import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
45

56
export default defineConfig({
67
server: {
78
port: 3001,
89
},
9-
plugins: [pluginReact(), pluginNodePolyfill()],
10+
plugins: [pluginReact(), pluginNodePolyfill(), pluginTypeCheck()],
1011
});

apps/recorder-form/src/components/CanvasSelector.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Button, Space } from 'antd';
21
import { useEffect, useRef, useState } from 'react';
32

43
interface CanvasElement {
@@ -279,14 +278,6 @@ const CanvasSelector: React.FC<CanvasSelectorProps> = ({
279278
setStartPoint(null);
280279
};
281280

282-
const handleDelete = () => {
283-
if (!selectedElement) return;
284-
const newElements = elements.filter((el) => el.id !== selectedElement.id);
285-
setElements(newElements);
286-
setSelectedElement(null);
287-
onChange?.(newElements);
288-
};
289-
290281
return (
291282
<div>
292283
<canvas

apps/report/rsbuild.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { pluginLess } from '@rsbuild/plugin-less';
66
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
77
import { pluginReact } from '@rsbuild/plugin-react';
88
import { pluginSvgr } from '@rsbuild/plugin-svgr';
9+
import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
910

1011
// Read all JSON files from test-data directory
1112
const testDataDir = path.join(__dirname, 'test-data');
@@ -156,5 +157,6 @@ export default defineConfig({
156157
pluginNodePolyfill(),
157158
pluginSvgr(),
158159
copyReportTemplate(),
160+
pluginTypeCheck(),
159161
],
160162
});

0 commit comments

Comments
 (0)