milliorn / Grocery-List

Found non-null assertions JS-0339
Anti-pattern
7 months ago7 months old
Forbidden non-null assertion
 75  function updateTask(id: string): void {
 76    const text = prompt("Item Name");
 77    const quantity = prompt("Quantity");
 78    const data = JSON.parse(localStorage.getItem("itemAdded")!) as object | any; 79
 80    const myData = data.map((x: { id: string }) => {
 81      if (x.id === id) {
Forbidden non-null assertion
 17  const [showItem, setShowItem] = useState(false);
 18
 19  /* https://stackoverflow.com/a/46915314/11986604 */
 20  const getGrocery = JSON.parse(localStorage.getItem("itemAdded")!) as object; 21
 22  /**
 23   * Read