-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 19.4 KB
/
.eslintcache
1
[{"/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/index.js":"1","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/reportWebVitals.js":"2","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/api/api-manager.js":"3","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/App.jsx":"4","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/snackbars.jsx":"5","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/operation.jsx":"6","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/transactions.jsx":"7","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/transaction.jsx":"8","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/category.jsx":"9","/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/index.js":"10","/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/App.jsx":"11","/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/reportWebVitals.js":"12","/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/api/api-manager.js":"13","/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/snackbars.jsx":"14","/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/transactions.jsx":"15","/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/operation.jsx":"16","/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/category.jsx":"17","/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/transaction.jsx":"18"},{"size":504,"mtime":1609384076206,"results":"19","hashOfConfig":"20"},{"size":362,"mtime":1609384076207,"results":"21","hashOfConfig":"20"},{"size":387,"mtime":1609384076204,"results":"22","hashOfConfig":"20"},{"size":2719,"mtime":1609384076203,"results":"23","hashOfConfig":"20"},{"size":511,"mtime":1609384076205,"results":"24","hashOfConfig":"20"},{"size":3260,"mtime":1609384076219,"results":"25","hashOfConfig":"20"},{"size":2373,"mtime":1609384076373,"results":"26","hashOfConfig":"20"},{"size":742,"mtime":1609384076205,"results":"27","hashOfConfig":"20"},{"size":1435,"mtime":1609384076204,"results":"28","hashOfConfig":"20"},{"size":504,"mtime":1609384207321,"results":"29","hashOfConfig":"30"},{"size":2719,"mtime":1609384207316,"results":"31","hashOfConfig":"30"},{"size":362,"mtime":1609384207323,"results":"32","hashOfConfig":"30"},{"size":387,"mtime":1609384207318,"results":"33","hashOfConfig":"30"},{"size":511,"mtime":1609384207319,"results":"34","hashOfConfig":"30"},{"size":2373,"mtime":1609384207320,"results":"35","hashOfConfig":"30"},{"size":3260,"mtime":1609384207319,"results":"36","hashOfConfig":"30"},{"size":1435,"mtime":1609384207318,"results":"37","hashOfConfig":"30"},{"size":742,"mtime":1609384207320,"results":"38","hashOfConfig":"30"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"telyll",{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"43"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"46","usedDeprecatedRules":"43"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"49","usedDeprecatedRules":"43"},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"43"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"54","usedDeprecatedRules":"43"},{"filePath":"55","messages":"56","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"57","usedDeprecatedRules":"43"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"43"},{"filePath":"60","messages":"61","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"43"},{"filePath":"62","messages":"63","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1h2ihxt",{"filePath":"64","messages":"65","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"70","messages":"71","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"72","messages":"73","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"74","messages":"75","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"76","messages":"77","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"78","messages":"79","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/index.js",[],"/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/reportWebVitals.js",[],["80","81"],"/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/api/api-manager.js",["82"],"import axios from 'axios'\n\nexport default {\n addTransaction: async transaction => await axios.post('http://localhost:3001/transaction',transaction),\n getTransactions: async () => await axios.get('http://localhost:3001/transactions').then(data => data.data),\n deleteTransaction: async id => await axios.delete(`http://localhost:3001/transaction/${id}`).then(status => status)\n}\n","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/App.jsx",["83"],"import './App.css';\nimport 'materialize-css/dist/css/materialize.css'\nimport '@fortawesome/fontawesome-free/css/all.css'\nimport {useEffect, useState} from 'react'\nimport Operations from './components/operation';\nimport CustomizedSnackbars from './components/snackbars';\nimport { BrowserRouter as Router,Route,Link} from 'react-router-dom'\nimport Transactions from './components/transactions';\nimport apiManager from './api/api-manager'\nimport Categories from './components/category';\n\n\n\nfunction App() {\n\n //setUp\n const [balance,setBalance] = useState(0)\n const [transactions,setTransactions] = useState([])\n\n const updateTransactions = () => apiManager.getTransactions().then(data => setTransactions(data))\n\n useEffect(() => updateTransactions(),[])\n\n useEffect(() => {\n let sum = 0 \n transactions.forEach(t => sum += t.amount)\n setBalance(sum)\n\n },[transactions])\n //setUp\n\n const deleteTrans = async id => {\n await apiManager.deleteTransaction(id)\n updateTransactions()\n }\n\n //snackBar \n const [toShow,setToShow] = useState(false)\n const [severity,setSeverity] = useState(\"\")\n const [message,setMessage] = useState(\"\")\n\n const alert = (s,t,ts) => {\n setSeverity(s)\n setMessage(t)\n setToShow(ts)\n }\n\n const alertSuccess = msg=> alert(\"success\",msg,true)\n const alertError = msg=> alert(\"error\",msg,true)\n\n const handleClose = () => setToShow(false)\n //snackBar \n\n return (\n <div>\n <Router>\n <div>\n <nav>\n <div className=\"nav-wrapper red lighten-1\">\n <a className=\"brand-logo hide-on-small-and-down right\"><i className=\"fas fa-hand-holding-usd logo\"></i></a>\n <ul id=\"nav-mobile\" className=\"left \">\n <li><span className=\"hide-on-small-and-down\">Balance:</span> {balance}$ </li>\n <li><Link to=\"/operations\">Operations</Link></li>\n <li><Link to=\"/transactions\">Transactions</Link></li>\n <li><Link to=\"/transactions/categories\">Categories</Link></li>\n\n </ul>\n </div>\n </nav>\n <Route path=\"/operations\" exact render={() => <Operations alert={[alertError,alertSuccess]} balance={balance} updateTransactions={updateTransactions}/>} />\n <Route path=\"/transactions/categories\" exact render={() => <Categories transactions={transactions} deleteTrans={deleteTrans}/>} />\n <Route path=\"/transactions\" exact render={() => <Transactions transactions={transactions} deleteTrans={deleteTrans}/>} />\n </div>\n </Router>\n <CustomizedSnackbars severity={severity} toShow={toShow} message={message} handleClose={handleClose} />\n </div>\n );\n}\n\nexport default App;","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/snackbars.jsx",[],"/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/operation.jsx",["84","85"],"import { useState } from 'react';\nimport apiManager from '../api/api-manager'\n\nfunction Operations(props) {\n const {balance,updateTransactions} = props\n\n //inputs\n const [amount,setAmount] = useState(0)\n const [category,setCategory] = useState(\"\")\n const [vendor,setVendor] = useState(\"\")\n const [date,setDate] = useState(\"\")\n let type = 0\n\n const inputSetters = {\n amount: setAmount,\n category: setCategory,\n vendor: setVendor,\n date: setDate\n }\n\n const inputHandler = e => {\n const {value,name} = e.target\n inputSetters[name](value.toLowerCase())\n }\n //inputs\n\n const [alertError,alertSuccess] = props.alert\n\n const error = msg => {\n alertError(msg)\n return false\n }\n\n const isValidInput = d => {\n if(amount < 1)\n return error(\"Amount cannot be negative or 0.\")\n\n //will show insuficient funds only if the day of the transaction is today else its in the past so it can go under... i guess\n const currentDate = new Date()\n currentDate.setHours(0,0,0,0);\n if(currentDate.getTime() === d.getTime())\n if(balance + (type * amount) < 0 && balance + (type * amount) < balance)\n return error(\"Insufficient Funds.\")\n if(category === \"\")\n return error(\"Category can not be empty.\")\n if(vendor === \"\")\n return error(\"Vendor can not be empty.\")\n\n\n return true\n }\n\n\n const addTrans = async () => {\n const d = (date === \"\" ? new Date() : new Date(date))\n d.setHours(0,0,0,0);\n if(isValidInput(d)){\n const status = await apiManager.addTransaction({\n amount: (amount * type),\n vendor,category,\n date: d \n })\n if(status.status === 200){\n alertSuccess(\"Transaction saved\")\n updateTransactions()\n }\n else\n alertError(`Error while saving ${status.status}`)\n }\n }\n\n const deposit = () => {\n type = 1\n addTrans()\n }\n const withdraw = async () => {\n type = -1\n addTrans()\n }\n\n return (\n <div className=\"row mid-page\">\n <input className=\"col s12 l6 offset-l3 center\" name=\"amount\" placeholder=\"*Amount $\" type=\"number\" onChange={inputHandler}></input>\n <input className=\"col s12 l6 offset-l3 center\" name=\"category\" placeholder=\"*Category\" onChange={inputHandler}></input>\n <input className=\"col s12 l6 offset-l3 center\" name=\"vendor\" placeholder=\"*Vendor\" onChange={inputHandler}></input>\n <input className=\"col s12 l6 offset-l3 center\" id=\"date-input\" name=\"date\" type=\"date\" onChange={inputHandler}></input>\n <div className=\"col s12 l6 offset-l3 center\" id=\"date-info\">Date of transaction(if untouched it will take current time)</div>\n <div >\n <a className=\"col s5 offset-s1 l2 offset-l4 waves-effect waves-light btn red darken-4\" onClick={deposit}>Deposit</a>\n <a className=\"col s5 l2 waves-effect waves-light btn red darken-4\" onClick={withdraw}>Withdraw</a>\n </div>\n </div>\n );\n}\n\nexport default Operations;\n","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/transactions.jsx",["86","87","88","89"],"import { useEffect, useState } from \"react\";\nimport M from 'materialize-css'\nimport Transaction from \"./transaction\";\n\n\nfunction Transactions(props) {\n const {transactions,id} = props\n const [transactionsFinal,setTransactionsFinal] = useState([])\n\n const [month,setMonth] = useState(\"Month\")\n const monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\n ];\n const filterByMonth = () => {\n if(month === \"All\" || month === \"Month\")\n setTransactionsFinal(transactions)\n else\n setTransactionsFinal(transactions.filter(t => {\n const d = new Date(t.date)\n const tMonth = d.getMonth() -1\n return monthNames[tMonth] === month\n }))\n }\n const monthPicker = e => {\n const m = e.target.name\n setMonth(m)\n }\n\n //useEffect\n useEffect(() => {\n const elems = document.querySelectorAll('.dropdown-trigger');\n M.Dropdown.init(elems);\n })\n useEffect(() => setTransactionsFinal(transactions),[])\n useEffect(() => filterByMonth(),[transactions])\n useEffect(() => filterByMonth(),[month])\n //useEffect\n\n return (\n\n <div>\n <a className='dropdown-trigger btn red darken-4' href='#' data-target={id || \"drop1\"} >{month}</a>\n\n <ul id={id || \"drop1\"} className='dropdown-content'>\n <li><a href=\"#!\" className=\"red-text text-lighten-1\" onClick={monthPicker} name=\"All\">All</a></li>\n {monthNames.map(m => <li><a href=\"#!\" className=\"red-text text-lighten-1\" onClick={monthPicker} name={m}>{m}</a></li>)}\n </ul>\n <table className=\"centered\">\n <thead>\n <tr className=\"\">\n <th>Date</th>\n <th>Amount</th>\n <th>Category</th>\n <th>Vendor</th>\n <th></th>\n </tr>\n </thead>\n\n <tbody>\n {transactionsFinal.map(t => <Transaction key={t._id} id={t._id} amount={t.amount} vendor={t.vendor} category={t.category} deleteTrans={props.deleteTrans} date={t.date}/>)}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport default Transactions;\n","/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/transaction.jsx",[],"/Users/asaid/Desktop/Excersize-Elevation/projects/bank/src/components/category.jsx",[],"/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/index.js",[],"/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/App.jsx",["90"],"/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/reportWebVitals.js",[],"/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/api/api-manager.js",["91"],"/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/snackbars.jsx",[],"/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/transactions.jsx",["92","93","94","95"],"/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/operation.jsx",["96","97"],"/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/category.jsx",[],"/Users/asaid/Desktop/Excersize-Elevation/projects/Bank/src/components/transaction.jsx",[],{"ruleId":"98","replacedBy":"99"},{"ruleId":"100","replacedBy":"101"},{"ruleId":"102","severity":1,"message":"103","line":3,"column":1,"nodeType":"104","endLine":7,"endColumn":2},{"ruleId":"105","severity":1,"message":"106","line":60,"column":17,"nodeType":"107","endLine":60,"endColumn":72},{"ruleId":"105","severity":1,"message":"106","line":89,"column":17,"nodeType":"107","endLine":89,"endColumn":122},{"ruleId":"105","severity":1,"message":"106","line":90,"column":17,"nodeType":"107","endLine":90,"endColumn":103},{"ruleId":"108","severity":1,"message":"109","line":34,"column":56,"nodeType":"110","endLine":34,"endColumn":58,"suggestions":"111"},{"ruleId":"108","severity":1,"message":"112","line":35,"column":37,"nodeType":"110","endLine":35,"endColumn":51,"suggestions":"113"},{"ruleId":"108","severity":1,"message":"112","line":36,"column":37,"nodeType":"110","endLine":36,"endColumn":44,"suggestions":"114"},{"ruleId":"105","severity":1,"message":"115","line":42,"column":13,"nodeType":"107","endLine":42,"endColumn":100},{"ruleId":"105","severity":1,"message":"106","line":60,"column":17,"nodeType":"107","endLine":60,"endColumn":72},{"ruleId":"102","severity":1,"message":"103","line":3,"column":1,"nodeType":"104","endLine":7,"endColumn":2},{"ruleId":"108","severity":1,"message":"109","line":34,"column":56,"nodeType":"110","endLine":34,"endColumn":58,"suggestions":"116"},{"ruleId":"108","severity":1,"message":"112","line":35,"column":37,"nodeType":"110","endLine":35,"endColumn":51,"suggestions":"117"},{"ruleId":"108","severity":1,"message":"112","line":36,"column":37,"nodeType":"110","endLine":36,"endColumn":44,"suggestions":"118"},{"ruleId":"105","severity":1,"message":"115","line":42,"column":13,"nodeType":"107","endLine":42,"endColumn":100},{"ruleId":"105","severity":1,"message":"106","line":89,"column":17,"nodeType":"107","endLine":89,"endColumn":122},{"ruleId":"105","severity":1,"message":"106","line":90,"column":17,"nodeType":"107","endLine":90,"endColumn":103},"no-native-reassign",["119"],"no-negated-in-lhs",["120"],"import/no-anonymous-default-export","Assign object to a variable before exporting as module default","ExportDefaultDeclaration","jsx-a11y/anchor-is-valid","The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an 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","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'transactions'. Either include it or remove the dependency array.","ArrayExpression",["121"],"React Hook useEffect has a missing dependency: 'filterByMonth'. Either include it or remove the dependency array.",["122"],["123"],"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",["124"],["125"],["126"],"no-global-assign","no-unsafe-negation",{"desc":"127","fix":"128"},{"desc":"129","fix":"130"},{"desc":"131","fix":"132"},{"desc":"127","fix":"133"},{"desc":"129","fix":"134"},{"desc":"131","fix":"135"},"Update the dependencies array to be: [transactions]",{"range":"136","text":"137"},"Update the dependencies array to be: [filterByMonth, transactions]",{"range":"138","text":"139"},"Update the dependencies array to be: [filterByMonth, month]",{"range":"140","text":"141"},{"range":"142","text":"137"},{"range":"143","text":"139"},{"range":"144","text":"141"},[1116,1118],"[transactions]",[1156,1170],"[filterByMonth, transactions]",[1208,1215],"[filterByMonth, month]",[1116,1118],[1156,1170],[1208,1215]]