1// A generic object used for ToDos
2const todoobject = (heading: string, text: string, date: string, priority: string, iD:number, projectiDs:number[], done = false) => {3 return { heading, text, date, priority, iD, projectiDs};
4};
5
13 if (user) {
14 const uid = user.uid;
15 try {
16 const docRef = await updateDoc(doc(collection(db, "users"), uid), {17 [type]: JSON.stringify(toDosCopy)
18 });
19 } catch (e) {
21 // Password reset email sent!
22 // ..
23 })
24 .catch((error) => {25
26
27 // ..
39 });
40 // ...
41 })
42 .catch((error) => {43
44 // ..
45 });
33 displayName: name
34 }).then(() => {
35 alert("User registered successfully");
36 }).catch((error) => {37 // An error occurred
38 // ...
39 });
Unused variables are generally considered a code smell and should be avoided.
Removing unused references - It prevents unused modules from being loaded at runtime, improving performance, and preventing the compiler from loading metadata that will never be used. - It prevents conflicts that may occur when trying to reference another variable.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
import fs from 'fs' // <- unused
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)
import { readFileSync } from 'fs'
const text = readFileSync('declaration_of_independence.txt', 'utf-8')
console.log(text)