-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 5.11 KB
/
.eslintcache
1
[{"/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/App.js":"1","/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/reportWebVitals.js":"2","/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/firebase.js":"3","/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/components/LinkForm.js":"4","/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/components/Link.js":"5","/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/index.js":"6"},{"size":340,"mtime":1615337377769,"results":"7","hashOfConfig":"8"},{"size":362,"mtime":1611785144214,"results":"9","hashOfConfig":"8"},{"size":503,"mtime":1612493595418,"results":"10","hashOfConfig":"8"},{"size":2209,"mtime":1615432459150,"results":"11","hashOfConfig":"8"},{"size":2411,"mtime":1615432567374,"results":"12","hashOfConfig":"8"},{"size":573,"mtime":1614646498211,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"16"},"bw4pz8",{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"16"},{"filePath":"19","messages":"20","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"16"},{"filePath":"21","messages":"22","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"23"},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"16"},"/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/App.js",[],["28","29"],"/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/reportWebVitals.js",[],"/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/firebase.js",[],"/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/components/LinkForm.js",["30"],"import React, { useState, useEffect } from 'react';\nimport { db } from '../firebase';\n\nconst LinkForm = (props) => {\n\n const initialStateAttributes = {\n url: '',\n name: '',\n description: ''\n }\n\n const [formValues, setFormValues] = useState(initialStateAttributes)\n\n const handleInputChange = (e) => {\n const { name, value } = e.target\n setFormValues({...formValues, [name]: value})\n }\n\n const handleSubmit = (e) => {\n e.preventDefault();\n props.addOrEditLink(formValues);\n setFormValues({...initialStateAttributes})\n }\n \n const getLinkById = async (id) => {\n const doc = await db.collection('links').doc(id).get();\n setFormValues({...doc.data()});\n }\n \n useEffect(() => {\n if (props.currentId === ''){\n setFormValues({...initialStateAttributes})\n } else {\n getLinkById(props.currentId);\n }\n }, [props.currentId])\n\n return (\n <form className=\"card card-body\" onSubmit={handleSubmit}>\n <div className=\"form-group input-group\">\n <div className=\"input-group-text bg-light\">\n <i className=\"material-icons\">insert_link</i>\n </div>\n <input \n type=\"text\" \n className=\"form-control\" \n name=\"url\" \n placeholder=\"url.com\" \n onChange={handleInputChange}\n value={formValues.url}\n />\n </div>\n\n <div className=\"form-group input-group\">\n <div className=\"input-group-text bg-light\">\n <i className=\"material-icons\">create</i>\n </div>\n <input \n type=\"text\" \n className=\"form-control\" \n name=\"name\" \n placeholder=\"Name\" \n onChange={handleInputChange} \n value={formValues.name}\n />\n </div>\n\n <div className=\"form-group\">\n <textarea \n name=\"description\" \n rows=\"3\" \n className=\"form-control\" \n placeholder=\"Write a description\" \n onChange={handleInputChange}\n value={formValues.description}\n ></textarea>\n </div>\n\n <button className=\"btn btn-primary\">\n {props.currentId === '' ? \"Save\" : \"Update\"}\n </button>\n </form>\n )\n}\n\nexport default LinkForm;","/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/components/Link.js",[],"/mnt/c/Users/pedro/code/react-projects/react-firebase-crud/src/index.js",[],{"ruleId":"31","replacedBy":"32"},{"ruleId":"33","replacedBy":"34"},{"ruleId":"35","severity":1,"message":"36","line":36,"column":6,"nodeType":"37","endLine":36,"endColumn":23,"suggestions":"38"},"no-native-reassign",["39"],"no-negated-in-lhs",["40"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'initialStateAttributes'. Either include it or remove the dependency array.","ArrayExpression",["41"],"no-global-assign","no-unsafe-negation",{"desc":"42","fix":"43"},"Update the dependencies array to be: [initialStateAttributes, props.currentId]",{"range":"44","text":"45"},[856,873],"[initialStateAttributes, props.currentId]"]