-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 4.57 KB
/
.eslintcache
1
[{"D:\\Projects\\React\\react-chat\\react-chat-app\\src\\reportWebVitals.js":"1","D:\\Projects\\React\\react-chat\\react-chat-app\\src\\App.js":"2","D:\\Projects\\React\\react-chat\\react-chat-app\\src\\chat-room\\chat-room.js":"3","D:\\Projects\\React\\react-chat\\react-chat-app\\src\\index.js":"4"},{"size":362,"mtime":1610534096708,"results":"5","hashOfConfig":"6"},{"size":1580,"mtime":1610632072609,"results":"7","hashOfConfig":"6"},{"size":3991,"mtime":1610634697643,"results":"8","hashOfConfig":"6"},{"size":500,"mtime":1606116598050,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"5wwil6",{"filePath":"12","messages":"13","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"14"},{"filePath":"15","messages":"16","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"D:\\Projects\\React\\react-chat\\react-chat-app\\src\\reportWebVitals.js",[],"D:\\Projects\\React\\react-chat\\react-chat-app\\src\\App.js",["19","20"],"import React, { useState, useEffect } from \"react\";\nimport socketIOClient from 'socket.io-client';\nimport ChatRoom from './chat-room/chat-room';\nimport './App.css';\n\nlet socket = socketIOClient('http://localhost:5001', { transports: ['websocket'] });\n\nfunction App() {\n const [username, setUsername] = useState(null);\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n\n useEffect(() => {\n\n socket.on('connection', () => {\n\n });\n\n const username = localStorage.getItem(\"username\");\n if (username) {\n setIsLoggedIn(true);\n }\n\n socket.on('disconnect', () => {\n\n });\n\n }, []);\n\n function addUser() {\n if (username && username.trim() != \"\") {\n\n if (socket.disconnected == true) {\n socket.connect();\n }\n\n localStorage.setItem(\"username\", username);\n setIsLoggedIn(true);\n socket.emit(\"add-user\", username);\n }\n else {\n alert(\"Please enter any username for identity\");\n }\n }\n\n function onLogout() {\n socket.disconnect();\n setIsLoggedIn(false);\n setUsername('');\n }\n\n return (\n <>\n {\n !isLoggedIn ?\n <div className=\"register\">\n <div className=\"user-control\">\n <input className=\"input-control\" type=\"text\" placeholder=\"Enter Username\" onChange={(ev) => setUsername(ev.target.value)} />\n <button className=\"add-user cursor-pointer\" type=\"button\" onClick={addUser}>Add User</button>\n </div>\n </div>\n :\n <ChatRoom socket={socket} onLogout={onLogout} />\n }\n </>\n );\n}\n\nexport default App;","D:\\Projects\\React\\react-chat\\react-chat-app\\src\\chat-room\\chat-room.js",["21","22","23","24","25"],"D:\\Projects\\React\\react-chat\\react-chat-app\\src\\index.js",[],{"ruleId":"26","severity":1,"message":"27","line":30,"column":37,"nodeType":"28","messageId":"29","endLine":30,"endColumn":39},{"ruleId":"26","severity":1,"message":"30","line":32,"column":31,"nodeType":"28","messageId":"29","endLine":32,"endColumn":33},{"ruleId":"31","severity":1,"message":"32","line":46,"column":22,"nodeType":"33","endLine":46,"endColumn":26},{"ruleId":"31","severity":1,"message":"34","line":47,"column":24,"nodeType":"35","endLine":47,"endColumn":34},{"ruleId":"26","severity":1,"message":"30","line":73,"column":46,"nodeType":"28","messageId":"29","endLine":73,"endColumn":48},{"ruleId":"26","severity":1,"message":"30","line":85,"column":58,"nodeType":"28","messageId":"29","endLine":85,"endColumn":60},{"ruleId":"26","severity":1,"message":"27","line":102,"column":57,"nodeType":"28","messageId":"29","endLine":102,"endColumn":59},"eqeqeq","Expected '!==' and instead saw '!='.","BinaryExpression","unexpected","Expected '===' and instead saw '=='.","react-hooks/exhaustive-deps","Assignments to the 'socket' variable from inside React Hook useEffect will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside useEffect.","Literal","Assignments to the 'onLogout' variable from inside React Hook useEffect will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside useEffect.","ArrowFunctionExpression"]