Context
Custom helpers added to drizzleHelpers always use table-style checking (options at arg[1] with an exclude array). This was fixed in #117 — before the fix, custom helpers with an ObjectExpression first arg were misrouted to model-style checking, producing false positives on every config property.
Table-style is the correct safe default. But it means a model-style wrapper like hydrateDrizzleModel cannot get model-style exclude checking without explicit config.
Proposed API
A drizzleHelperKind map that pins a custom helper to 'table' or 'model' style:
'@umpire/no-write-owned-fields': ['warn', {
drizzleHelpers: ['hydrateDrizzleModel'],
drizzleHelperKind: { hydrateDrizzleModel: 'model' },
}]
With 'model', the rule checks each entry value for { table, exclude } shape. Without it, the safe default (table-style) applies.
When to do this
When a real custom model-style helper use case emerges. The current table-style fallback produces no false positives and the limitation is documented.
Related
Context
Custom helpers added to
drizzleHelpersalways use table-style checking (options at arg[1] with anexcludearray). This was fixed in #117 — before the fix, custom helpers with an ObjectExpression first arg were misrouted to model-style checking, producing false positives on every config property.Table-style is the correct safe default. But it means a model-style wrapper like
hydrateDrizzleModelcannot get model-style exclude checking without explicit config.Proposed API
A
drizzleHelperKindmap that pins a custom helper to'table'or'model'style:With
'model', the rule checks each entry value for{ table, exclude }shape. Without it, the safe default (table-style) applies.When to do this
When a real custom model-style helper use case emerges. The current table-style fallback produces no false positives and the limitation is documented.
Related
helperArgIndexfor write helpers with non-standard candidate positions