Repository navigation
ci(lint): reject duplicate webhook switch cases - #1648
Conversation
No other findings in the specified diff. |
|
Addressed the P1 with a real built-CLI webhook invocation (generic JSON endpoint; no provider × agent matrix needed). Using head Observed: The receiver returned 200 and verified the parsed JSON payload and content type. The verification harness was temporary and was not added to the PR. This directly exercises the changed generic JSON formatter through the built CLI. The Node 24 Ubuntu check currently has one unrelated flaky concurrency assertion in |
jeff-r2026
left a comment
There was a problem hiding this comment.
Verified on latest main (4ea4bf2): merges cleanly; tsc / lint / build pass; webhook unit tests 28/28. Probe on main: each of the two rules fires exactly once (src/webhook.ts redundant case 'json', git-exclude test findIndex). Real CLI: built CLI with a team repo whose sharing.webhooks has one type: json endpoint; teamai webhook test exits 0 and the receiver gets application/json {event: webhook-test, ...}, same payload as main. The Node 24 ubuntu failure was the flaky workflow-local-driver concurrency case; it passed on rerun. Approving.
* ci(lint): reject duplicate webhook switch cases * ci(lint): prefer direct array value lookup
Summary
This is one small anti-slop follow-up under #836, combining two genuine diagnostics in the same cleanup class:
unicorn/no-useless-switch-caseand remove the redundantcase 'json'in webhook formatting—thedefaultbranch already formats generic JSON payloads;unicorn/prefer-array-index-ofand replace a predicate-only equalityfindIndex()withindexOf()in the git-exclude fixture helper.Both rules are currently outside the enabled categories, and each probe identified exactly one safe diagnostic in the tree. This is not a repeat of a category-default rule.
Related to #836.
Rule probes
After the changes, the full type-aware lint pass reports 0 warnings / 0 errors.
Verification
npm run lintcompleted its Oxlint phase with 0 warnings / 0 errors. Its following repository documentation verifier reports existing generated-doc/workflow example drift unrelated to these files.Slai Agent Runtime performed the investigation, implementation, and verification. The account owner authorized this contribution and is responsible for its content.