Skip to content

Commit

Permalink
chore: Fix or suppress eslint warnings introduced with UpdateData. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDuckworth authored Oct 3, 2023
1 parent da4f8f8 commit eb88276
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
2 changes: 2 additions & 0 deletions dev/src/bulk-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ export class BulkWriterError extends Error {
readonly message: string,

/** The document reference the operation was performed on. */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
readonly documentRef: firestore.DocumentReference<any, any>,

/** The type of operation performed. */
Expand Down Expand Up @@ -782,6 +783,7 @@ export class BulkWriter {
*/
onWriteResult(
successCallback: (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
documentRef: firestore.DocumentReference<any, any>,
result: WriteResult
) => void
Expand Down
5 changes: 3 additions & 2 deletions dev/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1401,8 +1401,9 @@ export class Firestore implements firestore.Firestore {
* ```
*/
recursiveDelete(
ref:
| firestore.CollectionReference<any, any>
ref: // eslint-disable-next-line @typescript-eslint/no-explicit-any
| firestore.CollectionReference<any, any>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
| firestore.DocumentReference<any, any>,
bulkWriter?: BulkWriter
): Promise<void> {
Expand Down
16 changes: 4 additions & 12 deletions dev/src/reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2095,9 +2095,7 @@ export class Query<
* ```
*/
startAt(
...fieldValuesOrDocumentSnapshot: Array<
firestore.DocumentSnapshot<any, any> | unknown
>
...fieldValuesOrDocumentSnapshot: Array<unknown>
): Query<AppModelType, DbModelType> {
validateMinNumberOfArguments(
'Query.startAt',
Expand Down Expand Up @@ -2141,9 +2139,7 @@ export class Query<
* ```
*/
startAfter(
...fieldValuesOrDocumentSnapshot: Array<
firestore.DocumentSnapshot<any, any> | unknown
>
...fieldValuesOrDocumentSnapshot: Array<unknown>
): Query<AppModelType, DbModelType> {
validateMinNumberOfArguments(
'Query.startAfter',
Expand Down Expand Up @@ -2186,9 +2182,7 @@ export class Query<
* ```
*/
endBefore(
...fieldValuesOrDocumentSnapshot: Array<
firestore.DocumentSnapshot<any, any> | unknown
>
...fieldValuesOrDocumentSnapshot: Array<unknown>
): Query<AppModelType, DbModelType> {
validateMinNumberOfArguments(
'Query.endBefore',
Expand Down Expand Up @@ -2231,9 +2225,7 @@ export class Query<
* ```
*/
endAt(
...fieldValuesOrDocumentSnapshot: Array<
firestore.DocumentSnapshot<any, any> | unknown
>
...fieldValuesOrDocumentSnapshot: Array<unknown>
): Query<AppModelType, DbModelType> {
validateMinNumberOfArguments(
'Query.endAt',
Expand Down
1 change: 1 addition & 0 deletions dev/src/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ export class Transaction implements firestore.Transaction {
* ```
*/
delete(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
documentRef: DocumentReference<any, any>,
precondition?: firestore.Precondition
): this {
Expand Down
1 change: 1 addition & 0 deletions dev/src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const WATCH_IDLE_TIMEOUT_MS = 120 * 1000;
/*!
* Sentinel value for a document remove.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const REMOVED = {} as DocumentSnapshotBuilder<any, any>;

/*!
Expand Down
1 change: 1 addition & 0 deletions dev/src/write-batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export class WriteBatch implements firestore.WriteBatch {
* ```
*/
delete(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
documentRef: firestore.DocumentReference<any, any>,
precondition?: firestore.Precondition
): WriteBatch {
Expand Down
10 changes: 10 additions & 0 deletions dev/test/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ describe('FirestoreTypeConverter', () => {
};
},
};
// The intent of the function below is to test TypeScript compile and not execute.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function _(docRef: DocumentReference): Promise<void> {
const newDocRef = docRef.withConverter(converter);
await newDocRef.set({stringProperty: 'foo', numberProperty: 42});
Expand Down Expand Up @@ -66,6 +68,8 @@ describe('FirestoreTypeConverter', () => {
};
},
};
// The intent of the function below is to test TypeScript compile and not execute.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function _(docRef: DocumentReference): Promise<void> {
const newDocRef = docRef.withConverter(converter);
await newDocRef.set({stringProperty: 'foo', numberProperty: 42});
Expand Down Expand Up @@ -109,6 +113,8 @@ describe('FirestoreTypeConverter', () => {
};
},
};
// The intent of the function below is to test TypeScript compile and not execute.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function _(docRef: DocumentReference): Promise<void> {
const newDocRef = docRef.withConverter(converter);
await newDocRef.set({stringProperty: 'foo', numberProperty: 42});
Expand Down Expand Up @@ -136,6 +142,8 @@ describe('FirestoreTypeConverter', () => {
};
},
};
// The intent of the function below is to test TypeScript compile and not execute.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function _(docRef: DocumentReference): Promise<void> {
const newDocRef = docRef.withConverter(converter);
await newDocRef.set({stringProperty: 'foo', numberProperty: 42});
Expand Down Expand Up @@ -167,6 +175,8 @@ describe('FirestoreTypeConverter', () => {
};
},
};
// The intent of the function below is to test TypeScript compile and not execute.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function _(docRef: DocumentReference): Promise<void> {
const newDocRef = docRef.withConverter(converter);
await newDocRef.set({stringProperty: 'foo', numberProperty: 42});
Expand Down

0 comments on commit eb88276

Please sign in to comment.