Context
no-write-owned-fields checks write candidate arguments by looking at a hardcoded position per helper name (getCandidateIndex). The six built-in helpers from @umpire/write and @umpire/drizzle are covered. Custom helpers added via writeHelpers fall back to index 1 (checkCreate-style).
This silently fails for Drizzle-style wrappers where the candidate is at index 2 or 3:
// checkPrismaCreate(model, ump, data, options?) — candidate at index 2
'@umpire/no-write-owned-fields': ['warn', {
writeHelpers: ['checkPrismaCreate', 'checkPrismaModelCreate'],
}]
// ↑ silently checks index 1 (the ump instance), never fires
Proposed API
A helperArgIndex map that supplements (not replaces) the hardcoded table:
'@umpire/no-write-owned-fields': ['warn', {
writeHelpers: ['checkPrismaCreate', 'checkPrismaModelCreate'],
helperArgIndex: { checkPrismaCreate: 2, checkPrismaModelCreate: 2 },
}]
The built-in helpers keep their hardcoded positions. The map is only consulted for helpers not already in the hardcoded table.
When to do this
Hold until a second first-party adapter (@umpire/prisma or similar) exists — that gives a real call shape to validate the API against and ensures the argument convention in CONTRIBUTING.md is actually being followed. The current documentation note in the schema description is the interim mitigation.
Related
drizzleHelperKind option for model-style custom drizzle helpers (separate issue)
CONTRIBUTING.md §Database Adapters — documents the argument convention new adapters must follow
Context
no-write-owned-fieldschecks write candidate arguments by looking at a hardcoded position per helper name (getCandidateIndex). The six built-in helpers from@umpire/writeand@umpire/drizzleare covered. Custom helpers added viawriteHelpersfall back to index 1 (checkCreate-style).This silently fails for Drizzle-style wrappers where the candidate is at index 2 or 3:
Proposed API
A
helperArgIndexmap that supplements (not replaces) the hardcoded table:The built-in helpers keep their hardcoded positions. The map is only consulted for helpers not already in the hardcoded table.
When to do this
Hold until a second first-party adapter (
@umpire/prismaor similar) exists — that gives a real call shape to validate the API against and ensures the argument convention inCONTRIBUTING.mdis actually being followed. The current documentation note in the schema description is the interim mitigation.Related
drizzleHelperKindoption for model-style custom drizzle helpers (separate issue)CONTRIBUTING.md§Database Adapters — documents the argument convention new adapters must follow