-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 17.2 KB
/
.eslintcache
1
[{"/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/index.js":"1","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/App.js":"2","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/reportWebVitals.js":"3","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/Main.js":"4","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/Header.js":"5","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/Login.js":"6","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/CreateProduct.js":"7","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/SignUp.js":"8"},{"size":478,"mtime":1609106883892,"results":"9","hashOfConfig":"10"},{"size":733,"mtime":1609345324383,"results":"11","hashOfConfig":"10"},{"size":362,"mtime":1609106116010,"results":"12","hashOfConfig":"10"},{"size":1517,"mtime":1609346979819,"results":"13","hashOfConfig":"10"},{"size":1688,"mtime":1609345580776,"results":"14","hashOfConfig":"10"},{"size":1814,"mtime":1609346499554,"results":"15","hashOfConfig":"10"},{"size":2068,"mtime":1609346850938,"results":"16","hashOfConfig":"10"},{"size":2187,"mtime":1609345891415,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},"c54ph9",{"filePath":"21","messages":"22","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"23","usedDeprecatedRules":"20"},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"20"},{"filePath":"26","messages":"27","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"28","usedDeprecatedRules":"20"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"31","usedDeprecatedRules":"32"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"35","usedDeprecatedRules":"20"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":"38","usedDeprecatedRules":"20"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"41","usedDeprecatedRules":"20"},"/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/index.js",[],["42","43"],"/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/App.js",["44"],"import React from \"react\";\nimport {\n BrowserRouter as Router,\n Switch,\n Route,\n Link\n} from \"react-router-dom\";\n\nimport Main from './components/Main'\nimport Header from './components/Header'\nimport Login from './components/Login'\nimport SignUp from './components/SignUp'\nimport CreateProduct from './components/CreateProduct'\n\nfunction App() {\n return (\n <Router>\n <Header/>\n <br/><br/><br/><br/>\n <Switch>\n <Route path=\"/\" exact component={Main}/>\n <Route path=\"/signin\" exact component={Login}/>\n <Route path=\"/signup\" exact component={SignUp}/>\n <Route path=\"/createproduct\" exact component={CreateProduct}/>\n </Switch>\n </Router>\n );\n}\n\nexport default App;\n","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/reportWebVitals.js",[],"/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/Main.js",["45","46","47","48"],"import React, {useState,useEffect} from \"react\";\nimport {\n BrowserRouter as Router,\n Switch,\n Route,\n} from \"react-router-dom\";\nimport axios from 'axios';\nimport Cookies from 'universal-cookie';\n\nfunction Main() {\n const [datas, setDatas] = useState({});\n const cookies = new Cookies();\n\n useEffect(() => {\n axios\n .get(\"http://localhost:3000/products\")\n .then(response => setDatas(response.data.products));\n }, [datas.length]);\n\n const deleteProduct = (productId) => {\n const token = cookies.get('token');\n\n axios.delete(`http://localhost:3000/products/${productId}`,\n {headers:{\n 'Authorization':`Bearer ${token}`}})\n .then(res =>{\n console.log(res.data.message)\n })\n .catch(err =>{\n console.log(err.message)\n })\n\n }\n\n return (\n <div className=\"container\">\n {Object.keys(datas).map((index) => (\n <div className=\"card\" style={{'maxWidth': 35+'rem'}}>\n <img src={datas[index].productImage} className=\"card-img-top\" alt='...'/>\n <div className=\"card-body text-center\">\n <h5 className=\"card-title\">{datas[index].name}</h5>\n <p className=\"card-text\">Price: {datas[index].price}</p>\n <a href=\"#\" className=\"btn btn-dark\">Add to cart</a>\n <button className=\"btn btn-danger\" onClick={() => deleteProduct(datas[index]._id)}>Delete Product</button>\n </div>\n </div>\n ))}\n \n </div>\n );\n }\n \n export default Main;\n ","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/Header.js",["49","50"],"import React,{useState} from 'react';\nimport {\n BrowserRouter as Router,\n Link\n} from \"react-router-dom\";\n\nimport Cookie from 'universal-cookie';\n\nfunction Header() {\n const cookie = new Cookie();\n const token = cookie.get('token');\n\n const logout = () => {\n cookie.remove('token');\n }\n return (\n <>\n <nav className=\"navbar navbar-dark bg-dark fixed-top\">\n <a href=\"/\" className=\"navbar-brand p-2\" style={{'fontSize':25}}>Burak İmdat</a>\n \n <form className=\"form-inline p-1\">\n <Link to=\"/\">\n <h2 className=\"btn btn-link btn-light m-1 \">Home</h2>\n </Link>\n {token ? (\n <>\n <Link to=\"/cart\">\n <h2 className=\"btn btn-link btn-light m-1 \">Cart</h2>\n </Link>\n <Link to=\"/createproduct\">\n <h2 className=\"btn btn-link btn-light m-1 \">Create Product</h2>\n </Link>\n <Link to=\"/signout\">\n <h2 className=\"btn btn-link btn-light m-1\" onClick={logout}>Logout</h2>\n </Link>\n </>\n ) : (\n <>\n <Link to=\"/signin\">\n <h2 className=\"btn btn-link btn-light m-1 \">Sign In</h2>\n </Link>\n <Link to=\"/signup\">\n <h2 className=\"btn btn-link btn-light m-1 \">Sign Up</h2>\n </Link>\n </>\n )}\n </form>\n \n \n </nav>\n \n </>\n );\n}\n\nexport default Header;\n",["51","52"],"/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/Login.js",["53","54","55","56"],"import React, {useState,useEffect} from \"react\";\nimport {\n BrowserRouter as Router,\n Switch,\n Route,\n} from \"react-router-dom\";\nimport axios from 'axios';\nimport Cookies from 'universal-cookie';\n\n//http://localhost:3000/user/signin\n\nfunction Login(){\n const [mail, setMail] = useState('');\n const [pass, setPass] = useState('');\n const [data,setData] = useState({});\n const cookies = new Cookies();\n\n const signin = async() => {\n await axios\n .post(\"http://localhost:3000/user/signin\",\n {email:mail,password:pass},\n {headers:{'Content-Type':'Application/json'}})\n .then(response => setData(response.data))\n .catch(err => console.log(err))\n\n cookies.set('token',data.token,[]);\n }\n\n const deneme = () => {\n console.log(cookies.get('token',[]));\n }\n\n return(\n <div className=\"container text-center\">\n <button className=\"btn btn-success\" onClick={deneme}>Deneme Butonu</button>\n\n <div className=\"mb-3\">\n <label className=\"form-label\">Email address</label>\n <input onChange={e => setMail(e.target.value)} type=\"email\" className=\"form-control\" id=\"exampleInputEmail1\" aria-describedby=\"emailHelp\"/>\n <div id=\"emailHelp\" className=\"form-text\">We'll never share your email with anyone else.</div>\n </div>\n <div className=\"mb-3\">\n <label className=\"form-label\">Password</label>\n <input onChange={e => setPass(e.target.value)} type=\"password\" className=\"form-control\" id=\"exampleInputPassword1\"/>\n </div>\n\n <button onClick={signin} className=\"btn btn-dark\">Submit</button>\n\n </div>\n )\n}\n\nexport default Login;","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/CreateProduct.js",["57","58","59","60","61"],"import React, {useState,useEffect} from \"react\";\nimport {\n BrowserRouter as Router,\n Switch,\n Route,\n} from \"react-router-dom\";\nimport axios from 'axios';\nimport Cookies from 'universal-cookie';\n\nfunction CreateProduct(){\n const [name,setName] = useState('');\n const [price,setPrice] = useState('');\n const [file,setFile] = useState('');\n const [result,setResult] = useState();\n const cookies = new Cookies();\n\n const save = () => {\n \n const token = cookies.get('token',[])\n\n const form = new FormData();\n form.append('name',name);\n form.append('price',price);\n form.append('productImage',file);\n\n axios.post('http://localhost:3000/products',\n form,\n {headers:{\n 'Content-Type':'multipart/form-data',\n 'Authorization':`Bearer ${token}`\n },\n }\n ).then(res =>{\n setResult(res)\n }).catch(err => {\n console.log(err)\n })\n\n }\n\n return(\n <div className=\"container\">\n <div className=\"mb-3\">\n <label className=\"form-label\">Name</label>\n <input onChange={e => setName(e.target.value)} type=\"text\" className=\"form-control\" id=\"exampleInputEmail1\" aria-describedby=\"emailHelp\"/>\n <div id=\"emailHelp\" className=\"form-text\">We'll never share your email with anyone else.</div>\n </div>\n <div className=\"mb-3\">\n <label className=\"form-label\">Price</label>\n <input onChange={e => setPrice(e.target.value)} type=\"number\" className=\"form-control\" id=\"exampleInputPassword1\"/>\n </div>\n <div className=\"mb-3\">\n <label className=\"form-label\">Product Image</label>\n <input onChange={e => setFile(e.target.files[0])} type=\"file\" className=\"form-control\" id=\"exampleInputPassword1\"/>\n </div>\n <button onClick={save} className=\"btn btn-primary\">Submit</button> \n </div>\n )\n}\n\nexport default CreateProduct;","/Users/burakbey/Desktop/NodeJs/node-rest-shop/front-end/node-rest-shop-front-end/src/components/SignUp.js",["62","63","64","65"],"import React, {useState,useEffect} from \"react\";\nimport {\n BrowserRouter as Router,\n Switch,\n Route,\n} from \"react-router-dom\";\nimport axios from 'axios';\nimport Cookies from 'universal-cookie';\n\n//http://localhost:3000/user/signup\n\nfunction SignUp(){\n const [mail, setMail] = useState('');\n const [pass, setPass] = useState('');\n const [data,setData] = useState({});\n const cookies = new Cookies();\n\n const signup = async() => {\n await axios\n .post(\"http://localhost:3000/user/signup\",\n {email:mail,password:pass},\n {headers:{'Content-Type':'Application/json'}})\n .then(res =>\n signin()\n )\n .catch(err => console.log(err))\n\n cookies.set('token',data.token,[]);\n }\n const signin = async() => {\n await axios\n .post(\"http://localhost:3000/user/signin\",\n {email:mail,password:pass},\n {headers:{'Content-Type':'Application/json'}})\n .then(response => setData(response.data))\n .catch(err => console.log(err))\n\n cookies.set('token',data.token,[]);\n }\n\n const deneme = () => {\n console.log(cookies.get('token',[]));\n }\n\n return(\n <div className=\"container text-center\">\n <button className=\"btn btn-success\" onClick={deneme}>Deneme Butonu</button>\n <div className=\"mb-3\">\n <label className=\"form-label\">Email address</label>\n <input onChange={e => setMail(e.target.value)} type=\"email\" className=\"form-control\" id=\"exampleInputEmail1\" aria-describedby=\"emailHelp\"/>\n <div id=\"emailHelp\" className=\"form-text\">We'll never share your email with anyone else.</div>\n </div>\n <div className=\"mb-3\">\n <label className=\"form-label\">Password</label>\n <input onChange={e => setPass(e.target.value)} type=\"password\" className=\"form-control\" id=\"exampleInputPassword1\"/>\n </div>\n\n <button onClick={signup} className=\"btn btn-dark\">Submit</button>\n </div>\n )\n}\n\nexport default SignUp;",{"ruleId":"66","replacedBy":"67"},{"ruleId":"68","replacedBy":"69"},{"ruleId":"70","severity":1,"message":"71","line":6,"column":3,"nodeType":"72","messageId":"73","endLine":6,"endColumn":7},{"ruleId":"70","severity":1,"message":"74","line":3,"column":20,"nodeType":"72","messageId":"73","endLine":3,"endColumn":26},{"ruleId":"70","severity":1,"message":"75","line":4,"column":3,"nodeType":"72","messageId":"73","endLine":4,"endColumn":9},{"ruleId":"70","severity":1,"message":"76","line":5,"column":3,"nodeType":"72","messageId":"73","endLine":5,"endColumn":8},{"ruleId":"77","severity":1,"message":"78","line":43,"column":16,"nodeType":"79","endLine":43,"endColumn":53},{"ruleId":"70","severity":1,"message":"80","line":1,"column":15,"nodeType":"72","messageId":"73","endLine":1,"endColumn":23},{"ruleId":"70","severity":1,"message":"74","line":3,"column":20,"nodeType":"72","messageId":"73","endLine":3,"endColumn":26},{"ruleId":"66","replacedBy":"81"},{"ruleId":"68","replacedBy":"82"},{"ruleId":"70","severity":1,"message":"83","line":1,"column":25,"nodeType":"72","messageId":"73","endLine":1,"endColumn":34},{"ruleId":"70","severity":1,"message":"74","line":3,"column":20,"nodeType":"72","messageId":"73","endLine":3,"endColumn":26},{"ruleId":"70","severity":1,"message":"75","line":4,"column":3,"nodeType":"72","messageId":"73","endLine":4,"endColumn":9},{"ruleId":"70","severity":1,"message":"76","line":5,"column":3,"nodeType":"72","messageId":"73","endLine":5,"endColumn":8},{"ruleId":"70","severity":1,"message":"83","line":1,"column":25,"nodeType":"72","messageId":"73","endLine":1,"endColumn":34},{"ruleId":"70","severity":1,"message":"74","line":3,"column":20,"nodeType":"72","messageId":"73","endLine":3,"endColumn":26},{"ruleId":"70","severity":1,"message":"75","line":4,"column":3,"nodeType":"72","messageId":"73","endLine":4,"endColumn":9},{"ruleId":"70","severity":1,"message":"76","line":5,"column":3,"nodeType":"72","messageId":"73","endLine":5,"endColumn":8},{"ruleId":"70","severity":1,"message":"84","line":14,"column":12,"nodeType":"72","messageId":"73","endLine":14,"endColumn":18},{"ruleId":"70","severity":1,"message":"83","line":1,"column":25,"nodeType":"72","messageId":"73","endLine":1,"endColumn":34},{"ruleId":"70","severity":1,"message":"74","line":3,"column":20,"nodeType":"72","messageId":"73","endLine":3,"endColumn":26},{"ruleId":"70","severity":1,"message":"75","line":4,"column":3,"nodeType":"72","messageId":"73","endLine":4,"endColumn":9},{"ruleId":"70","severity":1,"message":"76","line":5,"column":3,"nodeType":"72","messageId":"73","endLine":5,"endColumn":8},"no-native-reassign",["85"],"no-negated-in-lhs",["86"],"no-unused-vars","'Link' is defined but never used.","Identifier","unusedVar","'Router' is defined but never used.","'Switch' is defined but never used.","'Route' is defined but never used.","jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md","JSXOpeningElement","'useState' is defined but never used.",["85"],["86"],"'useEffect' is defined but never used.","'result' is assigned a value but never used.","no-global-assign","no-unsafe-negation"]