Huthaifa-Dev / project

Use shorthand property syntax for object literals JS-0240
Anti-pattern
Minor
a month agoa month old
Expected property shorthand
 87    const cart = carts.find((cart) => cart.id === getValues("cart"));
 88    if (addedProduct && cart) {
 89      toast.promise(
 90        dispatch(addProductToCart({ body: addedProduct, cart: cart })), 91        {
 92          loading: "Adding to cart...",
 93          success: "Added to cart",
Expected property shorthand
 71        );
 72      } else {
 73        toast.promise(
 74          dispatch(removeProductFromCart({ body: newItem, cart: cart })), 75          {
 76            loading: "Loading",
 77            success: "Success",
Expected property shorthand
 62    if (cart) {
 63      if (newItem.quantity > 0) {
 64        toast.promise(
 65          dispatch(updateProductFromCart({ body: newItem, cart: cart })), 66          {
 67            loading: "Loading",
 68            success: "Success",
Expected property shorthand
14  return createPortal(
15    <>
16      <div className="container" style={{ width: "100%" }}>
17        <div className="modal" style={{ width: width }}>18          <header className="modal__title">
19            <p>{title}</p>
20            <Button backgroundColor="white" onClick={onClose}>