test(repo): guard allocation drag helper boundaries
This commit is contained in:
@@ -164,6 +164,40 @@ export const rules = [
|
||||
],
|
||||
forbidden: [],
|
||||
},
|
||||
{
|
||||
file: "apps/web/src/hooks/timelineOptimisticAllocations.ts",
|
||||
maxLines: 80,
|
||||
required: [
|
||||
{
|
||||
pattern: /\bexport function reconcileOptimisticEntries\b/,
|
||||
message: "timeline optimistic helpers must keep server-reconciliation logic centralized",
|
||||
},
|
||||
],
|
||||
forbidden: [],
|
||||
},
|
||||
{
|
||||
file: "apps/web/src/hooks/timelineAllocationFinalize.ts",
|
||||
maxLines: 100,
|
||||
required: [
|
||||
{
|
||||
pattern: /\bexport function hasAllocationDateChange\b/,
|
||||
message: "timeline allocation finalize helpers must keep date-change detection centralized",
|
||||
},
|
||||
{
|
||||
pattern: /\bexport function shouldTreatAllocationDragAsClick\b/,
|
||||
message: "timeline allocation finalize helpers must keep click-vs-drag classification centralized",
|
||||
},
|
||||
{
|
||||
pattern: /\bexport function requiresAllocationFragmentExtraction\b/,
|
||||
message: "timeline allocation finalize helpers must keep segment extraction rules centralized",
|
||||
},
|
||||
{
|
||||
pattern: /\bexport function buildAllocationMovedSnapshot\b/,
|
||||
message: "timeline allocation finalize helpers must keep mutation snapshot creation centralized",
|
||||
},
|
||||
],
|
||||
forbidden: [],
|
||||
},
|
||||
{
|
||||
file: "apps/web/src/hooks/useTimelineDrag.ts",
|
||||
required: [
|
||||
@@ -183,6 +217,14 @@ export const rules = [
|
||||
pattern: /from "\.\/timelineRangeSelection\.js"/,
|
||||
message: "timeline drag must keep range preview and finalization delegated to the extracted helper module",
|
||||
},
|
||||
{
|
||||
pattern: /from "\.\/timelineOptimisticAllocations\.js"/,
|
||||
message: "timeline drag must keep optimistic allocation reconciliation delegated to the extracted helper module",
|
||||
},
|
||||
{
|
||||
pattern: /from "\.\/timelineAllocationFinalize\.js"/,
|
||||
message: "timeline drag must keep allocation drag completion rules delegated to the extracted helper module",
|
||||
},
|
||||
],
|
||||
forbidden: [
|
||||
{
|
||||
@@ -193,6 +235,10 @@ export const rules = [
|
||||
pattern: /\bfunction toClientX\b/,
|
||||
message: "timeline drag must not re-inline touch coordinate fallback helpers",
|
||||
},
|
||||
{
|
||||
pattern: /\bfunction (?:hasAllocationDateChange|shouldTreatAllocationDragAsClick|requiresAllocationFragmentExtraction|buildAllocationMovedSnapshot|reconcileOptimisticEntries)\b/,
|
||||
message: "timeline drag must not re-inline extracted optimistic or allocation finalize helper implementations",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user