-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 10.2 KB
/
.eslintcache
1
[{"/home/nikf/repos/ContactsAreNecessary/src/index.js":"1","/home/nikf/repos/ContactsAreNecessary/src/components/App.js":"2","/home/nikf/repos/ContactsAreNecessary/src/components/Header.js":"3","/home/nikf/repos/ContactsAreNecessary/src/components/ContactList.js":"4","/home/nikf/repos/ContactsAreNecessary/src/components/AddContact.js":"5","/home/nikf/repos/ContactsAreNecessary/src/components/Footer.js":"6","/home/nikf/repos/ContactsAreNecessary/src/components/EditContact.js":"7","/home/nikf/repos/ContactsAreNecessary/src/components/Delete.js":"8","/home/nikf/repos/ContactsAreNecessary/src/components/ContactDetail.js":"9","/home/nikf/repos/ContactsAreNecessary/src/components/Todo.js":"10","/home/nikf/repos/ContactsAreNecessary/src/context/ContactsCrudContext.js":"11","/home/nikf/repos/ContactsAreNecessary/src/components/ContactCard.js":"12","/home/nikf/repos/ContactsAreNecessary/src/api/objects.js":"13"},{"size":208,"mtime":1641340542462,"results":"14","hashOfConfig":"15"},{"size":1348,"mtime":1641340542462,"results":"16","hashOfConfig":"15"},{"size":312,"mtime":1641340542462,"results":"17","hashOfConfig":"15"},{"size":1675,"mtime":1641352874349,"results":"18","hashOfConfig":"15"},{"size":1733,"mtime":1641340542462,"results":"19","hashOfConfig":"15"},{"size":341,"mtime":1641340542462,"results":"20","hashOfConfig":"15"},{"size":2174,"mtime":1641340542462,"results":"21","hashOfConfig":"15"},{"size":1139,"mtime":1641340542462,"results":"22","hashOfConfig":"15"},{"size":885,"mtime":1641340542462,"results":"23","hashOfConfig":"15"},{"size":4221,"mtime":1641340542462,"results":"24","hashOfConfig":"15"},{"size":2579,"mtime":1641354533189,"results":"25","hashOfConfig":"15"},{"size":1021,"mtime":1641340542462,"results":"26","hashOfConfig":"15"},{"size":99,"mtime":1641340542462,"results":"27","hashOfConfig":"15"},{"filePath":"28","messages":"29","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"y6t5ud",{"filePath":"31","messages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"33","messages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"35","messages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"37","messages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"39","messages":"40","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"41","messages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"43","messages":"44","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"45","messages":"46","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"47","messages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"49","usedDeprecatedRules":"30"},{"filePath":"50","messages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"54","messages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"/home/nikf/repos/ContactsAreNecessary/src/index.js",[],["56","57"],"/home/nikf/repos/ContactsAreNecessary/src/components/App.js",[],"/home/nikf/repos/ContactsAreNecessary/src/components/Header.js",[],"/home/nikf/repos/ContactsAreNecessary/src/components/ContactList.js",["58"],"/home/nikf/repos/ContactsAreNecessary/src/components/AddContact.js",[],"/home/nikf/repos/ContactsAreNecessary/src/components/Footer.js",[],"/home/nikf/repos/ContactsAreNecessary/src/components/EditContact.js",[],"/home/nikf/repos/ContactsAreNecessary/src/components/Delete.js",[],"/home/nikf/repos/ContactsAreNecessary/src/components/ContactDetail.js",[],"/home/nikf/repos/ContactsAreNecessary/src/components/Todo.js",["59","60","61"],"import React, { useState, useEffect } from 'react';\nimport api from '../api/objects';\nimport { v4 as uuid } from 'uuid';\n\n\nconst Todo = () => {\n const [todos, setTodos] = useState([]);\n const [todo, setTodo] = useState([]);\n const [name, setName] = useState('');\n const [status, setStatus] = useState(\"\");\n\n // RetrieveTodos\n const retrieveTodos = async () => {\n const response = await api.get(\"/todos\");\n if (response.data) {\n setTodos(response.data);\n }\n };\n\n const addTodoHandler = async (todo) => {\n const request = {\n id: uuid(),\n ...todo,\n };\n const response = await api.post(\"/todos\", request);\n setTodos([...todos, response.data]);\n };\n\n const removeTodoHandler = async (id) => {\n await api.delete(`/todos/${id}`);\n const newTodoList = todos.filter((todo) => {\n return todo.id !== id;\n });\n\n setTodos(newTodoList);\n };\n\n const updateTodoHandler = async (todo) => {\n const response = await api.put(`/todos/${todo.id}`, todo);\n const { id } = response.data;\n setTodos(\n todos.map((todo) => {\n return todo.id === id ? { ...response.data } : todo;\n })\n );\n };\n \n /** Adds a new todo, verifying there's valid data. */\n const addTodo = (e) => {\n e.preventDefault();\n\n /** Removes empty space characters */\n setName(name.trim());\n setStatus(status.trim());\n \n /** Valid lengths for name and status */\n if(name.length < 3 || status.length < 1){\n alert('All fields must have a valid value!');\n clearStateData();\n return;\n }\n\n addTodoHandler({ name: name, status: status });\n clearStateData();\n };\n\n /** Simply clears all state values of the component. */\n const clearStateData = () => {\n setName('');\n setStatus('');\n }\n\n /** Loads all todo items, and returns empty json object if nothing is there. */\n useEffect(() => {\n retrieveTodos();\n }, []);\n\n\n const renderTodoList = (todos).map((todo) => {\n return (\n <div className=\"item\">\n <div className=\"content\">\n <div className=\"header\">{todo.name}</div>\n <div>{todo.status}</div>\n </div>\n <i \n className=\"icon hand point up outline\"\n onClick={() => alert(\"change!!!!!!\")}\n title=\"change status\"></i>\n <i \n className=\"trash icon red alternate outline\" \n onClick={() => removeTodoHandler(todo.id) }\n title=\"delete\"\n style={{ margin: \"4px\" }}></i>\n </div>\n );\n });\n\n return (\n <div className=\"ui main\">\n <div className=\"main\">\n <h2>Todo List</h2>\n <div className=\"ui celled list\">\n {renderTodoList}\n </div>\n </div>\n <div className=\"ui center menu\">\n <form \n className=\"ui form\"\n action=\"/\" \n onSubmit={addTodo} >\n <fieldset>\n <legend>Add Todo</legend>\n <input \n type=\"text\" \n className=\"ui field\"\n placeholder=\"Name\"\n name=\"name\"\n value={name}\n onChange={(e) => setName(e.target.value)} />\n <input \n type=\"text\" \n className=\"ui field\" \n placeholder=\"Status\"\n name=\"status\"\n value={status}\n onChange={(e) => setStatus(e.target.value)} />\n <button className=\"ui field button\">Submit</button>\n </fieldset>\n </form>\n </div>\n </div>\n );\n}\n\nexport default Todo;\n","/home/nikf/repos/ContactsAreNecessary/src/context/ContactsCrudContext.js",[],"/home/nikf/repos/ContactsAreNecessary/src/components/ContactCard.js",[],"/home/nikf/repos/ContactsAreNecessary/src/api/objects.js",[],{"ruleId":"62","replacedBy":"63"},{"ruleId":"64","replacedBy":"65"},{"ruleId":"66","severity":1,"message":"67","line":11,"column":6,"nodeType":"68","endLine":11,"endColumn":8,"suggestions":"69"},{"ruleId":"70","severity":1,"message":"71","line":8,"column":12,"nodeType":"72","messageId":"73","endLine":8,"endColumn":16},{"ruleId":"70","severity":1,"message":"74","line":8,"column":18,"nodeType":"72","messageId":"73","endLine":8,"endColumn":25},{"ruleId":"70","severity":1,"message":"75","line":38,"column":11,"nodeType":"72","messageId":"73","endLine":38,"endColumn":28},"no-native-reassign",["76"],"no-negated-in-lhs",["77"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'retrieveContacts'. Either include it or remove the dependency array.","ArrayExpression",["78"],"no-unused-vars","'todo' is assigned a value but never used.","Identifier","unusedVar","'setTodo' is assigned a value but never used.","'updateTodoHandler' is assigned a value but never used.","no-global-assign","no-unsafe-negation",{"desc":"79","fix":"80"},"Update the dependencies array to be: [retrieveContacts]",{"range":"81","text":"82"},[370,372],"[retrieveContacts]"]