Skip to content

Commit e2c7dcc

Browse files
nicohrubecclaude
andcommitted
refactor(server-utils): Drop dead firestore types and no-explicit-any disable
Remove the unused `DocumentData` type, the unread `FirestoreSettings.ssl` and `FirestoreLike.settings` members, and narrow the `toJSON` return to what `buildAttributes` actually reads. Switching the `FirebaseOptions` index signature to `unknown` lets the file drop its `no-explicit-any` eslint-disable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5ed0a41 commit e2c7dcc

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

packages/server-utils/src/integrations/tracing-channel/firebase/firestore-types.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
31
// Minimal structural types inlined from `firebase/app` and `firebase/firestore`, kept just wide enough
42
// for the attributes the subscriber reads off a Firestore reference. Inlined (rather than imported) so
53
// `@sentry/server-utils` needs no firebase dependency.
64

75
export interface FirebaseOptions {
8-
[key: string]: any;
6+
[key: string]: unknown;
97
apiKey?: string;
108
projectId?: string;
119
appId?: string;
@@ -20,17 +18,11 @@ export interface FirebaseApp {
2018

2119
export interface FirestoreSettings {
2220
host?: string;
23-
ssl?: boolean;
2421
}
2522

2623
interface FirestoreLike {
2724
app: FirebaseApp;
28-
settings: FirestoreSettings;
29-
toJSON: () => { app: FirebaseApp; settings: FirestoreSettings };
30-
}
31-
32-
export interface DocumentData {
33-
[field: string]: any;
25+
toJSON: () => { settings?: FirestoreSettings };
3426
}
3527

3628
export interface DocumentReference {

packages/server-utils/src/integrations/tracing-channel/firebase/firestore.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ export function getPortAndAddress(settings: FirestoreSettings): {
8282
function buildAttributes(reference: FirestoreReference): SpanAttributes {
8383
const firestoreApp: FirebaseApp = reference.firestore.app;
8484
const firestoreOptions: FirebaseOptions = firestoreApp.options;
85-
const json: { settings?: FirestoreSettings } = reference.firestore.toJSON() || {};
86-
const settings: FirestoreSettings = json.settings || {};
85+
const settings: FirestoreSettings = reference.firestore.toJSON()?.settings || {};
8786

8887
const attributes: SpanAttributes = {
8988
[DB_COLLECTION_NAME]: reference.path,

0 commit comments

Comments
 (0)