-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 14.3 KB
/
.eslintcache
1
[{"/Users/jen/projects/petbnb/src/index.js":"1","/Users/jen/projects/petbnb/src/reportWebVitals.js":"2","/Users/jen/projects/petbnb/src/App.js":"3","/Users/jen/projects/petbnb/src/components/Header/Header.js":"4","/Users/jen/projects/petbnb/src/pages/SearchPage/SearchPage.js":"5","/Users/jen/projects/petbnb/src/components/Footer/Footer.js":"6","/Users/jen/projects/petbnb/src/pages/Home/Home.js":"7","/Users/jen/projects/petbnb/src/components/SearchResult/SearchResult.js":"8","/Users/jen/projects/petbnb/src/components/Card/Card.js":"9","/Users/jen/projects/petbnb/src/components/Banner/Banner.js":"10","/Users/jen/projects/petbnb/src/components/DatePicker/DatePicker.js":"11","/Users/jen/projects/petbnb/src/data/properties.js":"12","/Users/jen/projects/petbnb/src/context/AppContext.js":"13","/Users/jen/projects/petbnb/src/firebase.js":"14","/Users/jen/projects/petbnb/src/components/SearchWidget/SearchWidget.js":"15"},{"size":584,"mtime":1654654476565,"results":"16","hashOfConfig":"17"},{"size":362,"mtime":1610591463636,"results":"18","hashOfConfig":"17"},{"size":835,"mtime":1655014552314,"results":"19","hashOfConfig":"17"},{"size":723,"mtime":1654999422196,"results":"20","hashOfConfig":"17"},{"size":1205,"mtime":1655002220751,"results":"21","hashOfConfig":"17"},{"size":794,"mtime":1654999422250,"results":"22","hashOfConfig":"17"},{"size":28342,"mtime":1655003688969,"results":"23","hashOfConfig":"17"},{"size":1075,"mtime":1654999422195,"results":"24","hashOfConfig":"17"},{"size":654,"mtime":1655000542829,"results":"25","hashOfConfig":"17"},{"size":1281,"mtime":1654999422031,"results":"26","hashOfConfig":"17"},{"size":1254,"mtime":1610782147708,"results":"27","hashOfConfig":"17"},{"size":2665,"mtime":1654823255454,"results":"28","hashOfConfig":"17"},{"size":1445,"mtime":1654992557597,"results":"29","hashOfConfig":"17"},{"size":4320,"mtime":1654996215373,"results":"30","hashOfConfig":"17"},{"size":6894,"mtime":1655267527121,"results":"31","hashOfConfig":"17"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},"ke49lv",{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"51","usedDeprecatedRules":"34"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"54","usedDeprecatedRules":"34"},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"57"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"57"},{"filePath":"60","messages":"61","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"62","usedDeprecatedRules":"34"},{"filePath":"63","messages":"64","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"65","usedDeprecatedRules":"34"},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/jen/projects/petbnb/src/index.js",[],["68","69"],"/Users/jen/projects/petbnb/src/reportWebVitals.js",[],"/Users/jen/projects/petbnb/src/App.js",[],"/Users/jen/projects/petbnb/src/components/Header/Header.js",[],"/Users/jen/projects/petbnb/src/pages/SearchPage/SearchPage.js",[],"/Users/jen/projects/petbnb/src/components/Footer/Footer.js",[],"/Users/jen/projects/petbnb/src/pages/Home/Home.js",[],"/Users/jen/projects/petbnb/src/components/SearchResult/SearchResult.js",[],"/Users/jen/projects/petbnb/src/components/Card/Card.js",["70"],"import React from \"react\";\nimport \"./Card.css\";\nimport StarIcon from \"@mui/icons-material/Star\";\n\n// use destructuring assignment to specify props' properties as parameters\nconst Card = ({ src, title, rating, description, price }) => {\n return (\n <div className=\"card\">\n <img src={src} alt=\"home-image\" />\n <div className=\"card_info\">\n <div className=\"card_info-title\">\n <h2>{title}</h2>\n <span>\n <StarIcon />\n <span>{rating}</span>\n </span>\n </div>\n <h4>{description}</h4>\n {price && <h3>{price}/night</h3>}\n </div>\n </div>\n );\n};\n\nexport default Card;\n","/Users/jen/projects/petbnb/src/components/Banner/Banner.js",["71","72","73"],"import React, { useState } from \"react\";\nimport { useHistory } from \"react-router-dom\";\n// import DatePicker from \"../DatePicker/DatePicker\";\n// import { Button } from \"@material-ui/core\";\nimport SearchWidget from \"../SearchWidget/SearchWidget\";\nimport \"./Banner.css\";\n\nfunction Banner() {\n // use react-router's useHistory hook to redirect to SearchPage on clicking Explore nearby button\n const history = useHistory();\n\n // add state to allow toggle between 'Search Dates' and 'Hide' button\n const [showSearch, setShowSearch] = useState(false);\n\n return (\n <div className=\"banner\">\n {/* <div className=\"banner_search\">\n {showSearch && <DatePicker />}\n \n <Button \n onClick={() => setShowSearch(!showSearch)}\n className=\"banner_searchButton\"\n variant=\"outlined\"\n >\n {!showSearch ? \"Search dates\" : \"Hide\"}\n </Button>\n </div>\n <div className=\"banner_info\">\n <h1>Make sure your best friend is taken care of</h1>\n <h5>So you can travel with no regrets</h5>\n <Button onClick={() => history.push('/search')} variant=\"outlined\">Explore nearby</Button>\n </div> */}\n <div className=\"banner_image\"></div>\n <SearchWidget />\n </div>\n );\n}\n\nexport default Banner;\n","/Users/jen/projects/petbnb/src/components/DatePicker/DatePicker.js",[],["74","75"],"/Users/jen/projects/petbnb/src/data/properties.js",[],"/Users/jen/projects/petbnb/src/context/AppContext.js",["76"],"import React, { useState, useEffect } from \"react\";\nimport { realTimeDb } from \"../firebase\";\nimport { ref, set, onValue } from \"firebase/database\";\n// import PROPERTIES from \"../data/properties\";\n\nexport const Context = React.createContext(null);\n\nconst AppContext = ({ children }) => {\n const [user, setUser] = useState(null);\n const [homes, setHomes] = useState([]);\n\n const initAuthUser = () => {\n const authenticatedUser = localStorage.getItem(\"auth\");\n if (authenticatedUser) {\n setUser(JSON.parse(authenticatedUser));\n }\n };\n\n const initHomes = () => {\n // Write default homes to Firebase realTime db\n // PROPERTIES.map((property, idx) => {\n // const homeRef = ref(realTimeDb, \"homes/\" + idx);\n // set(homeRef, property);\n // });\n\n // Set default list of homes in state\n const homesRef = ref(realTimeDb, \"homes\");\n onValue(homesRef, (snapshot) => {\n let homes = [];\n snapshot.forEach((childSnapshot) => {\n let key = childSnapshot.key;\n let data = childSnapshot.val();\n homes.push({ key: key, data: data });\n });\n setHomes(homes);\n });\n };\n\n useEffect(() => {\n initAuthUser();\n initHomes();\n }, []);\n\n // TO DO: Define function to update user and home data here, and pass down via context\n\n return (\n <Context.Provider value={{ user: user, homes: homes }}>\n {children}\n </Context.Provider>\n );\n};\n\nexport default AppContext;\n","/Users/jen/projects/petbnb/src/firebase.js",["77"],"// Initialise Firebase. See https://firebase.google.com/docs/database/web/start#web-version-9\n\nimport { initializeApp, getApps, getApp } from \"firebase/app\";\nimport { getDatabase, ref, set, onValue } from \"firebase/database\";\n// import { getFirestore, collection, getDocs } from \"firebase/firestore\";\nimport { getAuth, onAuthStateChanged } from \"firebase/auth\";\n// import { getStorage, uploadBytes } from \"firebase/storage\";\n\nconst firebaseConfig = {\n apiKey: `${process.env.REACT_APP_FIREBASE_API_KEY}`,\n authDomain: `${process.env.REACT_APP_FIREBASE_AUTH_DOMAIN}`,\n databaseURL: `${process.env.REACT_APP_FIREBASE_DATABASE_URL}`,\n projectId: `${process.env.REACT_APP_FIREBASE_PROJECT_ID}`,\n storageBucket: `${process.env.REACT_APP_FIREBASE_STORAGE_BUCKET}`,\n messagingSenderId: `${process.env.REACT_APP_FIREABSE_MESSAGING_SENDER_ID}`,\n appId: `${process.env.REACT_APP_FIREBASE_APP_ID}`,\n};\n\nconst app = !getApps().length ? initializeApp(firebaseConfig) : getApp();\n\n// Get reference to realtime database service - NoSQL: data stored as single JSON tree\nexport const realTimeDb = getDatabase();\n\n// USER DATA\nexport const writeUserData = (userId, userName, email, imageUrl, host) => {\n // Create reference to path where realTimeDb will read/write data. Second argument to ref() is the path at which we want to interact with the data\n const userRef = ref(realTimeDb, \"users/\" + userId);\n\n // Write data to the reference - will overwrite any existing data at that ref\n set(userRef, {\n username: userName,\n email: email,\n profile_picture: imageUrl,\n host: host,\n });\n};\n\nexport const getUserName = (userId) => {\n // Create reference to path to get the data\n const userNameRef = ref(realTimeDb, \"users/\" + userId + \"/username\");\n // onValue is an observer that gets triggered when listener is attached, and when data (including child data) updates. Listener receives snapshot (of data) at time of event. val() gives you value of snapshot.\n onValue(userNameRef, (snapshot) => {\n const data = snapshot.val();\n // updateUserName(postElement, data); FIREBASE TUTORIAL EG\n console.log(\"userData:\", data);\n });\n};\n\n// HOMES DATA\nexport const writeHomeData = (\n userId,\n homeId,\n name,\n description,\n location,\n imageUrl,\n price,\n rating\n) => {\n const homeRef = ref(realTimeDb, \"homes/\" + homeId);\n\n set(homeRef, {\n createdBy: userId,\n name: name,\n description: description,\n location: location,\n src: imageUrl,\n pricePerNight: price,\n star: rating,\n });\n};\n\nexport const getHomeData = (homeId) => {\n const homeRef = ref(realTimeDb, \"homes/\" + homeId);\n onValue(homeRef, (snapshot) => {\n const data = snapshot.val();\n console.log(\"homeData:\", data);\n });\n};\n\n/* FIREBASE TUTORIAL NOTES - working with lists: use push(), which generates unique key based on timestamp to allow for several clients to add child data to the same location at the same time without write conflicts\neg adding post to list of posts by user\nconst postListRef = ref(db, 'post-comments/' + postId);\nconst newPostRef = push(postListRef);\nset(newPostRef, {\n //...\n});\n\nThen, to access that data, iterate through the snapshot (which returns entire list of data - ie don't use val()):\n\nconst commentsRef = ref(db, 'post-comments/' + postId);\nonValue(commentsRef, (snapshot) => {\n snapshot.forEach((childSnapshot) => {\n const childKey = childSnapshot.key;\n const childData = childSnapshot.val();\n });\n});\n\nMost of time, don't want to iterate entire list esp if large. Can listen to child events and use functions like onChildAdded(), onChildChanged(), onChildRemoved() eg:\nonChildAdded(commentsRef, (data) => {\n addCommentElement(postElement, data.key, data.val().text, data.val().author);\n});\nonChildChanged(commentsRef, (data) => {\n setCommentValues(postElement, data.key, data.val().text, data.val().author);\n});\n*/\n\n// Get Cloud Firestore instance - NoSQL: data stored as a collection of documents\n// export const db = getFirestore(app);\n\n// Get Firebase storage instance - stores files such as images and other user-generated content\n// export const storage = getStorage(app);\n\n// Get Auth instance associated with app and add an observer for changes to user's sign-in state\nexport const auth = getAuth();\nonAuthStateChanged(auth, (user) => {\n console.log(user);\n});\n","/Users/jen/projects/petbnb/src/components/SearchWidget/SearchWidget.js",[],{"ruleId":"78","replacedBy":"79"},{"ruleId":"80","replacedBy":"81"},{"ruleId":"82","severity":1,"message":"83","line":9,"column":7,"nodeType":"84","endLine":9,"endColumn":41},{"ruleId":"85","severity":1,"message":"86","line":10,"column":9,"nodeType":"87","messageId":"88","endLine":10,"endColumn":16},{"ruleId":"85","severity":1,"message":"89","line":13,"column":10,"nodeType":"87","messageId":"88","endLine":13,"endColumn":20},{"ruleId":"85","severity":1,"message":"90","line":13,"column":22,"nodeType":"87","messageId":"88","endLine":13,"endColumn":35},{"ruleId":"78","replacedBy":"91"},{"ruleId":"80","replacedBy":"92"},{"ruleId":"85","severity":1,"message":"93","line":3,"column":15,"nodeType":"87","messageId":"88","endLine":3,"endColumn":18},{"ruleId":"85","severity":1,"message":"94","line":19,"column":7,"nodeType":"87","messageId":"88","endLine":19,"endColumn":10},"no-native-reassign",["95"],"no-negated-in-lhs",["96"],"jsx-a11y/img-redundant-alt","Redundant alt attribute. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop.","JSXOpeningElement","no-unused-vars","'history' is assigned a value but never used.","Identifier","unusedVar","'showSearch' is assigned a value but never used.","'setShowSearch' is assigned a value but never used.",["95"],["96"],"'set' is defined but never used.","'app' is assigned a value but never used.","no-global-assign","no-unsafe-negation"]