-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
I'm using vue-concurrency with TypeScript and ESLint.
I am aware of the TypeScript limitations and that intermediate values need to be explicily typed or else they will be given a type of any
.
But after typing my intermediate values ESLint still complains about the any
value: Unsafe assignment of an 'any' value. eslint(@typescript-eslint/no-unsafe-assignment)
Here is my full code, with comment on the error line:
import { db } from 'src/firebase/config';
import { doc, getDoc, DocumentSnapshot } from 'firebase/firestore';
import { useTask } from 'vue-concurrency';
const getDocumentTask = useTask(function* (
signal,
collectionName: string,
documentId: string
) {
const documentReference = doc(db, collectionName, documentId);
const response: DocumentSnapshot = yield getDoc(documentReference); // <-- EsLint error here
const document: Record<string, unknown> = {
...response.data(),
documentId: response.id,
};
return document;
});
export default getDocumentTask;
Is this a bug or am I doing something wrong?
I could disable the ESLint error with // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
but I would rather solve the problem instead of disabling it.
Metadata
Metadata
Assignees
Labels
No labels