30 const products = useSelector(selectProducts);
31 const [filteredData, setFilteredData] = useState<Product[]>(products);
32 const [form, setForm] = React.useState<boolean>(false);
33 const [edittingID, setEdittingID] = React.useState<string>(""); 34 const [deletingID, setDeletingID] = React.useState<string>("");
35 const {
36 register,
215 control={control}
216 name="code"
217 defaultValue={getValues("code")}
218 render={({ field }) => (219 <InputMask
220 mask="aaaa-aaaa-9999"
221 {...register("code", {
83 }
84
85 const storageRef = ref(storage, "images/" + getValues("image")[0].name);
86 uploadBytes(storageRef, getValues("image")[0]).then((snapshot) => { 87 getDownloadURL(storageRef).then((url) => {
88 const product: Partial<Product> = {
89 ...data,
29 uploadBytes,
30 getDownloadURL,
31 listAll,
32 list, 33} from "firebase/storage";
34import { storage } from "../../firebase";
35const defaultValues = {
28 ref,
29 uploadBytes,
30 getDownloadURL,
31 listAll, 32 list,
33} from "firebase/storage";
34import { storage } from "../../firebase";
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)