1
0

chore: 强化代码质量与风格检查体系

ESLint 升级到 recommended-type-checked + stylistic-type-checked,
引入 perfectionist 导入排序和 import 插件导入验证。

Prettier 显式声明全部格式化参数,消除跨环境差异。
TypeScript 启用 noUnusedLocals 和 noPropertyAccessFromIndexSignature。
完善 ignore 列表,排除 .agents/、bun.lock、data/ 等。
引入 husky + lint-staged(pre-commit)+ commitlint(commit-msg)。
更新 DEVELOPMENT.md 代码质量章节。
修复所有新增规则检测到的类型和风格违规。
This commit is contained in:
2026-05-12 18:44:59 +08:00
parent ce8baae3d1
commit a5cf6065c2
83 changed files with 2654 additions and 1824 deletions

View File

@@ -1,36 +1,38 @@
import type { TargetStatus } from "../../shared/api";
import { GroupHeader } from "./GroupHeader";
import { PrimaryTable } from "tdesign-react";
import type { TargetStatus } from "../../shared/api";
import { TARGET_TABLE_COLUMNS } from "../constants/target-table-columns";
import { GroupHeader } from "./GroupHeader";
interface TargetGroupProps {
name: string;
targets: TargetStatus[];
onTargetClick: (target: TargetStatus) => void;
targets: TargetStatus[];
}
export function TargetGroup({ name, targets, onTargetClick }: TargetGroupProps) {
export function TargetGroup({ name, onTargetClick, targets }: TargetGroupProps) {
const up = targets.filter((t) => t.latestCheck?.matched).length;
const down = targets.length - up;
return (
<div>
<GroupHeader name={name} total={targets.length} up={up} down={down} />
<GroupHeader down={down} name={name} total={targets.length} up={up} />
<PrimaryTable
bordered
className="clickable-table"
columns={TARGET_TABLE_COLUMNS}
data={targets}
defaultSort={[{ descending: true, sortBy: "latestCheck.matched" }]}
hover
onRowClick={({ row }) => onTargetClick(row)}
rowClassName={({ row }) => {
const target = row;
return target.latestCheck?.matched === false ? "row-down" : "";
}}
rowKey="id"
size="small"
stripe
hover
bordered
defaultSort={[{ sortBy: "latestCheck.matched", descending: true }]}
onRowClick={({ row }) => onTargetClick(row as TargetStatus)}
rowClassName={({ row }) => {
const target = row as TargetStatus;
return target.latestCheck?.matched === false ? "row-down" : "";
}}
className="clickable-table"
/>
</div>
);