Huthaifa-Dev / project

Require template literals instead of string concatenation JS-0246
Anti-pattern
Minor
a month ago2 years old
Unexpected string concatenation
 82        return;
 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> = {
Unexpected string concatenation
 73        );
 74        navigate("/products");
 75      } else if (ID.productId) {
 76        const storageRef = ref(storage, "images/" + getValues("image")[0].name); 77        uploadBytes(storageRef, getValues("image")[0]).then((snapshot) => {
 78          getDownloadURL(storageRef).then((url) => {
 79            const product: Partial<Product> = {
Unexpected string concatenation
 23  "categories/getProducts",
 24  async () => {
 25    try {
 26      const response = await axios.get(PRODUCTS_URL + ".json"); 27      const result = Object.keys(response.data).map((key) => {
 28        const product = response.data[key];
 29        product.id = key;
Unexpected string concatenation
 28  "categories/getCategories",
 29  async () => {
 30    try {
 31      const response = await axios.get(CATEGORIES_URL + ".json"); 32      const result = Object.keys(response.data).map((key) => {
 33        const category = response.data[key];
 34        category.id = key;
Unexpected string concatenation
129      // update cart in db
130      await axios.patch(`${CARTS_URL}/${newCart.id}` + ".json", newCart);
131      // return updated carts
132      const response = await axios.get(CARTS_URL + ".json");133      const result = Object.keys(response.data).map((key) => {
134        const cart = response.data[key];
135        return cart;