-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 8.12 KB
/
.eslintcache
1
[{"C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\index.js":"1","C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\serviceWorkerRegistration.js":"2","C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\App.js":"3","C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\reportWebVitals.js":"4","C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\components\\TodoList.js":"5","C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\components\\Form.js":"6","C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\components\\Todo.js":"7","C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\components\\Edit.js":"8"},{"size":816,"mtime":1618617092857,"results":"9","hashOfConfig":"10"},{"size":5064,"mtime":499162500000,"results":"11","hashOfConfig":"10"},{"size":2869,"mtime":1619021582963,"results":"12","hashOfConfig":"10"},{"size":364,"mtime":499162500000,"results":"13","hashOfConfig":"10"},{"size":2012,"mtime":1619042106001,"results":"14","hashOfConfig":"10"},{"size":3711,"mtime":1619021012693,"results":"15","hashOfConfig":"10"},{"size":3429,"mtime":1619033854650,"results":"16","hashOfConfig":"10"},{"size":1158,"mtime":1619029028433,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},"13a7aq7",{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"23","messages":"24","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"29","messages":"30","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"31","usedDeprecatedRules":"20"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\index.js",[],["36","37"],"C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\serviceWorkerRegistration.js",[],"C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\App.js",["38"],"C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\reportWebVitals.js",[],"C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\components\\TodoList.js",["39"],"C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\components\\Form.js",["40"],"import React, { useState } from 'react';\r\nimport onClickOutside from 'react-onclickoutside';\r\n\r\nconst Form = ({ inputText, setInputText, priority, setPriority, todos, setTodos, status, setStatus }) => {\r\n\r\n const [id, setId] = useState(Math.floor(Math.random() * 10000));\r\n const [DropdownOpen, setDropdownOpen] = useState(false);\r\n\r\n const inputTextHandler = (e) => {\r\n setInputText(e.target.value)\r\n }\r\n\r\n // give id\r\n const idProvider = () => {\r\n const newId = Math.floor(Math.random() * 10000);\r\n\r\n setId(newId);\r\n }\r\n\r\n const getCurrentTime = () => {\r\n const date = new Date();\r\n const createdDate = date.toUTCString();\r\n return createdDate;\r\n }\r\n\r\n const submitTodoHandler = (e) => {\r\n idProvider();\r\n\r\n e.preventDefault();\r\n if (inputText.length <= 0) {\r\n alert(\"Please write something to add...\");\r\n } else if (inputText.length > 25) {\r\n alert(\"Max length is 25\");\r\n } else {\r\n setTodos([\r\n ...todos, {\r\n task: inputText,\r\n priority: priority,\r\n completed: false,\r\n createdDate: getCurrentTime(),\r\n id: id.toString()},\r\n ]);\r\n }\r\n setInputText(\"\");\r\n }\r\n\r\n const statusHandler = (option) => {\r\n setStatus(option);\r\n }\r\n\r\n const deleteAll = () => {\r\n setTodos([])\r\n }\r\n\r\n const changeColor = (e) => {\r\n e.preventDefault();\r\n \r\n const eleClass = e.target.className;\r\n\r\n switch (true) {\r\n case eleClass.includes('low'):\r\n setPriority('medium');\r\n break;\r\n \r\n case eleClass.includes('medium'):\r\n setPriority('high');\r\n break;\r\n\r\n case eleClass.includes('high'):\r\n setPriority('low');\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n return (\r\n <div>\r\n <form className=\"form\">\r\n <div className=\"form__box\">\r\n <button type=\"submit\" className=\"submit-bnt\" onClick={submitTodoHandler} >\r\n <i className=\"fas fa-plus\"></i>\r\n </button>\r\n <button className={`form__priority ${priority}`} onClick={changeColor}></button>\r\n <input type=\"text\" className=\"form__input\" placeholder=\"Add task\" value={inputText} onChange={inputTextHandler} />\r\n </div>\r\n </form>\r\n\r\n <section className=\"filter-section\">\r\n <button className=\"delete-all\" onClick={deleteAll}>Delete all tasks</button>\r\n\r\n <DropdownSelect\r\n statusHandler={statusHandler}\r\n status={status}\r\n DropdownOpen={DropdownOpen}\r\n setDropdownOpen={setDropdownOpen}/>\r\n </section>\r\n </div>\r\n );\r\n}\r\n\r\nfunction DropdownSelect({ status, statusHandler, DropdownOpen, setDropdownOpen }) {\r\n const closeDropdown = () => setDropdownOpen(!DropdownOpen);\r\n\r\n const select = (option) => {\r\n closeDropdown()\r\n statusHandler(option);\r\n }\r\n\r\n DropdownSelect.onClickOutside = () => setDropdownOpen(!DropdownOpen)\r\n\r\n return (\r\n <div className={`select`}>\r\n <header className=\"select__header\" onClick={() => setDropdownOpen(!DropdownOpen)}>\r\n <p className=\"select__title\">filter</p>\r\n <i className={`fas ${DropdownOpen ? 'fa-chevron-up' : 'fa-chevron-down'}`}></i>\r\n </header>\r\n\r\n {\r\n DropdownOpen\r\n ?\r\n <ul className=\"select__options\">\r\n <li className=\"select__option\" onClick={() => select(\"all\")}>\r\n All\r\n </li>\r\n <li className=\"select__option\" onClick={() => select(\"completed\")}>\r\n Completed\r\n </li>\r\n <li className=\"select__option\" onClick={() => select(\"uncompleted\")}>\r\n Uncompleted\r\n </li>\r\n </ul>\r\n :\r\n ''\r\n }\r\n </div>\r\n );\r\n}\r\n\r\nexport default Form;","C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\components\\Todo.js",[],"C:\\Users\\ddvit\\Documents\\projects\\Todo-app\\src\\components\\Edit.js",["41"],{"ruleId":"42","replacedBy":"43"},{"ruleId":"44","replacedBy":"45"},{"ruleId":"46","severity":1,"message":"47","line":25,"column":6,"nodeType":"48","endLine":25,"endColumn":21,"suggestions":"49"},{"ruleId":"50","severity":1,"message":"51","line":61,"column":1,"nodeType":"52","messageId":"53","endLine":61,"endColumn":15},{"ruleId":"54","severity":1,"message":"55","line":2,"column":8,"nodeType":"56","messageId":"57","endLine":2,"endColumn":22},{"ruleId":"58","severity":1,"message":"59","line":17,"column":31,"nodeType":"60","messageId":"61","endLine":17,"endColumn":33},"no-native-reassign",["62"],"no-negated-in-lhs",["63"],"react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'filterHandler' and 'saveLocalTodos'. Either include them or remove the dependency array.","ArrayExpression",["64"],"no-lone-blocks","Block is redundant.","BlockStatement","redundantBlock","no-unused-vars","'onClickOutside' is defined but never used.","Identifier","unusedVar","array-callback-return","Array.prototype.map() expects a value to be returned at the end of arrow function.","ArrowFunctionExpression","expectedAtEnd","no-global-assign","no-unsafe-negation",{"desc":"65","fix":"66"},"Update the dependencies array to be: [todos, status, filterHandler, saveLocalTodos]",{"range":"67","text":"68"},[654,669],"[todos, status, filterHandler, saveLocalTodos]"]