feat(quality): U14 ESLint 冗余 disable 指令清理 — unused eslint-disable 6→0, warnings 65→59
删除 6 处 U12 修复时标注的冗余 eslint-disable-next-line 指令 (eslint-plugin-react-hooks 版本演进后不再触发规则): - ResourceVisualEditor.tsx (set-state-in-effect) - StatChartPanel.tsx x2 (preserve-manual-memoization) - RdpDialog.tsx (set-state-in-effect) - WebShell.tsx (set-state-in-effect) - RdpAuditViewer.tsx (set-state-in-effect) 验证: ESLint errors=0, warnings 65→59, unused-disable 6→0, tsc -b=0, npm build✓, 17/17 集成测试通过, Docker healthy
This commit is contained in:
1 parent
e19c27707f
commit
5d4a99b8a9
6 files changed
+29
-6
No files matched your search
@@ -618,7 +618,6 @@ function IngressEditor({ manifest, clusterCode, onSave, saving, isCreate }: { ma
|
||||
// 加载集群 IngressClass 列表
|
||||
useEffect(() => {
|
||||
if (!clusterCode) return;
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setLoadingClasses(true);
|
||||
kubernetesApi.getIngressClasses(clusterCode).then((res: any) => {
|
||||
const list = Array.isArray(res) ? res : (res?.list || res || []);
|
||||
|
||||
@@ -69,7 +69,6 @@ export function StatChartPanel({ statTable, engine, query, onSaveAsAlert, onSave
|
||||
return samples[engine];
|
||||
}, [engine]);
|
||||
|
||||
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
||||
const chartData = useMemo(() => {
|
||||
if (!rows.length) return [];
|
||||
return rows.map(r => {
|
||||
@@ -77,7 +76,6 @@ export function StatChartPanel({ statTable, engine, query, onSaveAsAlert, onSave
|
||||
columns.forEach(c => { obj[c.name] = r[c.name]; });
|
||||
return obj;
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
||||
}, [rows, columns]);
|
||||
|
||||
// 判断是否有数据
|
||||
|
||||
@@ -396,7 +396,6 @@ export function RdpDialog({
|
||||
useUserStore.getState().token || localStorage.getItem("token") || "";
|
||||
const { width, height } = calcRdpViewport(false);
|
||||
// 会话分辨率跟随弹窗可用空间,减少大屏下固定 1024x800 造成的左右黑边。 // Logan.Li
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setDisplaySize({ width, height });
|
||||
setCanvasSize({ width, height });
|
||||
setStatus(t("server.rdpDialog.creating"));
|
||||
|
||||
@@ -78,7 +78,6 @@ export function WebShell() {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
loadServers();
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -125,7 +125,6 @@ export function RdpAuditViewer({ open, onOpenChange, sessionId, mode }: RdpAudit
|
||||
|
||||
useEffect(() => {
|
||||
if (!open || !sessionId) return;
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setStatus(mode === 'live' ? '正在连接 RDP 实时审计...' : '正在加载 RDP 录屏...');
|
||||
setLoading(true);
|
||||
setFrames([]);
|
||||
|
||||
Reference in new issue
Block a user