chore(api): clear remaining small ESLint warnings and enforce their rules - #2913
Conversation
…ules - Merge the duplicate Express `declare global` namespace blocks in the auth middleware. The namespace + empty-interface augmentation is the required pattern for extending Express types, so it carries a scoped disable comment. - Scope `n/no-process-exit` off for the process entry points (src/index.ts, src/tasks/index.ts), where exiting with a status code on startup failure, task completion, or an uncaught-exception handler is intended. Promotes @typescript-eslint/no-namespace, no-empty-object-type, and n/no-process-exit to error, and lowers the api --max-warnings ceiling. Behavior is unchanged: tsc and knip are clean.
🦋 Changeset detectedLatest commit: f57b476 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔴 Tier 4 — CriticalTouches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
Greptile SummaryThe PR converts the remaining API ESLint warnings into enforced rules while preserving narrowly documented exceptions for Express augmentation and process entry points.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/api/eslint.config.mjs | Promotes three lint rules to errors and correctly scopes the process-exit exemption to the two intended entry points. |
| packages/api/src/middleware/auth.ts | Consolidates equivalent Express global augmentations while placing targeted suppressions on the namespace and empty interface declarations. |
| packages/api/package.json | Reduces the permitted warning count to reflect the warnings removed by this change. |
| scripts/ci/ratchet-baseline.json | Updates suppression and assertion counts to values that do not breach the ratchet checker. |
| .changeset/eslint-api-oneoffs.md | Accurately documents the lint enforcement changes as an API patch release. |
Reviews (3): Last reviewed commit: "Merge branch 'main' into brandon/brandon..." | Re-trigger Greptile
Deep Review✅ No critical issues found. This is a mechanical ESLint-hardening change: three api rules promoted to Key verifications performed against the working tree:
🔵 P3 nitpicks (1)
Reviewers (3): correctness, maintainability, kieran-typescript. Testing gaps: no test exercises Note: the project-standards reviewer did not return before synthesis; the findings above reflect the three completed reviewers plus independent ratchet/lint verification. |
E2E Test Results✅ All tests passed • 295 passed • 1 skipped • 1098s
Tests ran across 4 shards in parallel. |
What
Clears the last small batch of api ESLint warnings and promotes their rules to
error.@typescript-eslint/no-namespacedeclare globalnamespace blocks; scoped disable (pattern is required)@typescript-eslint/no-empty-object-typeinterface User extends UserDocument {}(required for ExpressUseraugmentation)n/no-process-exitofffor the two process entry-point filesWhy
These are all legitimate patterns the linter flags, not real issues:
namespace Express { interface User … }) is the documented way to extend Express's types — interface merging is required, and a type alias / non-empty interface can't do it. I merged the two duplicatenamespace Expressblocks into one for tidiness and disabled the two rules on that single augmentation block with an explanatory comment.process.exit()insrc/index.ts(startup failure, last-resortuncaughtException/unhandledRejectionhandlers) andsrc/tasks/index.ts(CLI task completion/failure) is the intended behavior. Rather than 5 inline disables, the rule is scopedofffor just those two entry-point files — so it still guards against strayprocess.exit()elsewhere in the api.Promoting all three to
errorturns these into guardrails: new violations outside the sanctioned spots now fail lint. This is the last of the small mechanical/one-off batches (follows #2903, #2911, #2912).Verification
yarn lint(api) — pass (0 errors; 3 rules now enforced as error)tsc --noEmit(api) — clean (Express augmentation still resolves after the merge)yarn knip— clean--max-warningslowered 311 → 302Behavior is unchanged. Changeset included (
@hyperdx/apipatch).