build(deps-dev): bump typescript-eslint from 8.58.2 to 8.59.0 in the typescript-eslint group#69
Conversation
Bumps the typescript-eslint group with 1 update: [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint). Updates `typescript-eslint` from 8.58.2 to 8.59.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.59.0/packages/typescript-eslint) --- updated-dependencies: - dependency-name: typescript-eslint dependency-version: 8.59.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: typescript-eslint ... Signed-off-by: dependabot[bot] <support@github.com>
📝 WalkthroughWalkthroughA collection of small typing, casting and lint-tool updates across the repo: dependency bump for typescript-eslint, removal or relaxation of explicit TypeScript casts in hooks/callables/auth flows, minor test and helper timing/typing changes, a storage-instance typing simplification, and a few formatting/lint-line deletions. No public APIs were changed. Changes
Sequence Diagram(s)(Skipped — changes are small typing/formatting adjustments and do not introduce new multi-component control flow requiring visualization.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…tion errors Remove unnecessary type assertions surfaced by typescript-eslint 8.59.0. Add explicit Promise<MergeDuplicatesResult> return type to callback to avoid needing per-return type assertions.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
functions/src/callables/dispatch-responder-validation.ts (1)
114-123:⚠️ Potential issue | 🔴 CriticalAdd explicit type cast or type guard before calling
isValidReportTransition.After the typeof check on line 115,
rawStatushas typestring, butisValidReportTransitionexpects aReportStatus(union of specific string literals). Cast the value explicitly withrawStatus as ReportStatusor introduce a proper type guard that validates the value is a valid report status before the function call.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@functions/src/callables/dispatch-responder-validation.ts` around lines 114 - 123, rawStatus is only narrowed to string by the typeof check but isValidReportTransition expects a ReportStatus literal; add an explicit cast or guard before calling it: after the typeof rawStatus !== 'string' check, either validate rawStatus against the ReportStatus set (a type guard) or cast it with rawStatus as ReportStatus, then call isValidReportTransition(rawStatusAsReportStatus, to) in the existing conditional (referencing rawStatus, isValidReportTransition, ReportStatus and the to = 'assigned' constant) so the call no longer passes a plain string.functions/src/callables/shift-handoff.ts (1)
260-269:⚠️ Potential issue | 🟡 MinorUse a typed auth-claims helper to narrow the type at the boundary.
req.auth.tokenis cast toRecord<string, unknown>, leavingclaims.activeasunknowntype. The validation check at line 237 (claims.active !== true) does not narrow TypeScript's type forunknown, so assigning it toHandoffActor.claims.active(typed asboolean) fails strict type checking.Either narrow the claims type with a type guard or Zod schema before constructing
actor, or explicitly cast individual properties.Also applies to: 317-326
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@functions/src/callables/shift-handoff.ts` around lines 260 - 269, The code assigns req.auth.token (treated as Record<string, unknown>) to claims and then writes claims.active into HandoffActor.claims.active (boolean), which fails strict typing; fix by narrowing the claims type at the boundary (e.g., add a typed helper/type guard or Zod parse for req.auth.token) or explicitly extract and cast each property before building the actor (e.g., derive const active = typeof claims.active === 'boolean' ? claims.active : false and similarly narrow role/municipalityId/auth_time), then construct the actor using the narrowed variables so HandoffActor.claims.active is a boolean; apply the same pattern for the other occurrence around the block that builds actor (also referenced later near lines 317-326).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@functions/src/callables/dispatch-responder-validation.ts`:
- Around line 114-123: rawStatus is only narrowed to string by the typeof check
but isValidReportTransition expects a ReportStatus literal; add an explicit cast
or guard before calling it: after the typeof rawStatus !== 'string' check,
either validate rawStatus against the ReportStatus set (a type guard) or cast it
with rawStatus as ReportStatus, then call
isValidReportTransition(rawStatusAsReportStatus, to) in the existing conditional
(referencing rawStatus, isValidReportTransition, ReportStatus and the to =
'assigned' constant) so the call no longer passes a plain string.
In `@functions/src/callables/shift-handoff.ts`:
- Around line 260-269: The code assigns req.auth.token (treated as
Record<string, unknown>) to claims and then writes claims.active into
HandoffActor.claims.active (boolean), which fails strict typing; fix by
narrowing the claims type at the boundary (e.g., add a typed helper/type guard
or Zod parse for req.auth.token) or explicitly extract and cast each property
before building the actor (e.g., derive const active = typeof claims.active ===
'boolean' ? claims.active : false and similarly narrow
role/municipalityId/auth_time), then construct the actor using the narrowed
variables so HandoffActor.claims.active is a boolean; apply the same pattern for
the other occurrence around the block that builds actor (also referenced later
near lines 317-326).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 39626c84-ac39-4eeb-899f-e4ec99cd2e6b
⛔ Files ignored due to path filters (22)
functions/lib/__tests__/callables/merge-duplicates.test.js.mapis excluded by!**/*.mapfunctions/lib/__tests__/callables/shift-handoff.test.js.mapis excluded by!**/*.mapfunctions/lib/__tests__/helpers/rules-harness.d.ts.mapis excluded by!**/*.mapfunctions/lib/__tests__/helpers/rules-harness.js.mapis excluded by!**/*.mapfunctions/lib/__tests__/helpers/seed-factories.d.ts.mapis excluded by!**/*.mapfunctions/lib/__tests__/helpers/seed-factories.js.mapis excluded by!**/*.mapfunctions/lib/__tests__/rules/dispatches.rules.test.js.mapis excluded by!**/*.mapfunctions/lib/__tests__/rules/responder-direct-writes.rules.test.js.mapis excluded by!**/*.mapfunctions/lib/__tests__/services/rate-limit.test.js.mapis excluded by!**/*.mapfunctions/lib/__tests__/triggers/analytics-snapshot-writer.test.js.mapis excluded by!**/*.mapfunctions/lib/__tests__/triggers/on-media-finalize.test.js.mapis excluded by!**/*.mapfunctions/lib/callables/cancel-dispatch.js.mapis excluded by!**/*.mapfunctions/lib/callables/close-report.js.mapis excluded by!**/*.mapfunctions/lib/callables/dispatch-responder-validation.d.ts.mapis excluded by!**/*.mapfunctions/lib/callables/dispatch-responder-validation.js.mapis excluded by!**/*.mapfunctions/lib/callables/merge-duplicates.js.mapis excluded by!**/*.mapfunctions/lib/callables/reject-report.js.mapis excluded by!**/*.mapfunctions/lib/callables/shift-handoff.js.mapis excluded by!**/*.mapfunctions/lib/callables/verify-report.js.mapis excluded by!**/*.mapfunctions/lib/idempotency/guard.js.mapis excluded by!**/*.mapfunctions/lib/services/fcm-send.d.ts.mapis excluded by!**/*.mapfunctions/lib/services/fcm-send.js.mapis excluded by!**/*.map
📒 Files selected for processing (25)
apps/citizen-pwa/src/hooks/usePublicIncidents.tsapps/citizen-pwa/src/services/draft-store.tsapps/responder-app/src/hooks/useDispatch.tsfunctions/lib/__tests__/helpers/rules-harness.jsfunctions/lib/__tests__/helpers/seed-factories.d.tsfunctions/lib/__tests__/helpers/seed-factories.jsfunctions/lib/__tests__/rules/dispatches.rules.test.jsfunctions/lib/__tests__/rules/responder-direct-writes.rules.test.jsfunctions/lib/__tests__/services/rate-limit.test.jsfunctions/lib/__tests__/triggers/analytics-snapshot-writer.test.jsfunctions/lib/services/fcm-send.jsfunctions/src/__tests__/callables/merge-duplicates.test.tsfunctions/src/__tests__/callables/shift-handoff.test.tsfunctions/src/__tests__/services/rate-limit.test.tsfunctions/src/__tests__/triggers/on-media-finalize.test.tsfunctions/src/callables/cancel-dispatch.tsfunctions/src/callables/close-report.tsfunctions/src/callables/dispatch-responder-validation.tsfunctions/src/callables/merge-duplicates.tsfunctions/src/callables/reject-report.tsfunctions/src/callables/shift-handoff.tsfunctions/src/callables/verify-report.tsfunctions/src/idempotency/guard.tspackages/shared-firebase/src/env.test.tspackages/shared-ui/src/auth-provider.tsx
💤 Files with no reviewable changes (2)
- functions/lib/tests/helpers/seed-factories.js
- functions/lib/tests/services/rate-limit.test.js
|
Superseded by direct update to typescript-eslint 8.59.1 on main, which includes all fixes for the new lint rules. |
|
This pull request was built based on a group rule. Closing it will not ignore any of these versions in future pull requests. To ignore these dependencies, configure ignore rules in dependabot.yml |
Bumps the typescript-eslint group with 1 update: typescript-eslint.
Updates
typescript-eslintfrom 8.58.2 to 8.59.0Release notes
Sourced from typescript-eslint's releases.
Changelog
Sourced from typescript-eslint's changelog.
Commits
ea9ae4fchore(release): publish 8.59.0Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>will remove the ignore condition of the specified dependency and ignore conditionsSummary by CodeRabbit