-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 21.1 KB
/
.eslintcache
1
[{"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/App.js":"1","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/index.js":"2","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/MainContainer/MainContainer.js":"3","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Header/Header.js":"4","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Logo/Logo.js":"5","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/DefaultButton/DefaultButton.js":"6","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/NewStoryContainer/NewStoryContainer.js":"7","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/DefaultTextField/DefaultTextField.js":"8","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Story/Story.js":"9","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/theme.js":"10","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/context/StoriesContext.js":"11","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/utils/constants.js":"12","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/NotFoundContainer/NotFoundContainer.js":"13","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/StoryContainer/StoryContainer.js":"14","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/NewNewsletterContainer/NewNewsletterContainer.js":"15","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/RichTextEditor/RichTextEditor.js":"16","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/DefaultDatePicker/DefaultDatePicker.js":"17","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/context/NewslettersContext.js":"18","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Newsletter/Newsletter.js":"19","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Newsletter/StoryCard/StoryCard.js":"20","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/NewsletterContainer/NewsletterContainer.js":"21","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/utils/fetches.js":"22","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/utils/helperFns.js":"23"},{"size":2470,"mtime":1606603848281,"results":"24","hashOfConfig":"25"},{"size":419,"mtime":1606451534881,"results":"26","hashOfConfig":"25"},{"size":2646,"mtime":1606602952409,"results":"27","hashOfConfig":"25"},{"size":419,"mtime":1606603026055,"results":"28","hashOfConfig":"25"},{"size":258,"mtime":1606413723667,"results":"29","hashOfConfig":"25"},{"size":360,"mtime":1606537644355,"results":"30","hashOfConfig":"25"},{"size":3049,"mtime":1606706788174,"results":"31","hashOfConfig":"25"},{"size":338,"mtime":1606426870310,"results":"32","hashOfConfig":"25"},{"size":3995,"mtime":1606589342757,"results":"33","hashOfConfig":"25"},{"size":199,"mtime":1606418462866,"results":"34","hashOfConfig":"25"},{"size":329,"mtime":1606451501101,"results":"35","hashOfConfig":"25"},{"size":87,"mtime":1606603396529,"results":"36","hashOfConfig":"25"},{"size":312,"mtime":1606603325529,"results":"37","hashOfConfig":"25"},{"size":1592,"mtime":1606603383757,"results":"38","hashOfConfig":"25"},{"size":5486,"mtime":1606706326068,"results":"39","hashOfConfig":"25"},{"size":1201,"mtime":1606606110023,"results":"40","hashOfConfig":"25"},{"size":439,"mtime":1606599159046,"results":"41","hashOfConfig":"25"},{"size":361,"mtime":1606524489785,"results":"42","hashOfConfig":"25"},{"size":1036,"mtime":1606587905868,"results":"43","hashOfConfig":"25"},{"size":1355,"mtime":1606603147429,"results":"44","hashOfConfig":"25"},{"size":1714,"mtime":1606599798881,"results":"45","hashOfConfig":"25"},{"size":2362,"mtime":1606595354545,"results":"46","hashOfConfig":"25"},{"size":228,"mtime":1606599985004,"results":"47","hashOfConfig":"25"},{"filePath":"48","messages":"49","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"50","usedDeprecatedRules":"51"},"1f66a8n",{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"54"},{"filePath":"55","messages":"56","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"57","usedDeprecatedRules":"51"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"51"},{"filePath":"60","messages":"61","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"51"},{"filePath":"62","messages":"63","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"64"},{"filePath":"65","messages":"66","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"64"},{"filePath":"69","messages":"70","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"51"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"75"},{"filePath":"76","messages":"77","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"78","messages":"79","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"51"},{"filePath":"80","messages":"81","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"82","usedDeprecatedRules":"64"},{"filePath":"83","messages":"84","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"85","messages":"86","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"87","usedDeprecatedRules":"51"},{"filePath":"88","messages":"89","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"75"},{"filePath":"90","messages":"91","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"51"},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"51"},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"98","usedDeprecatedRules":"99"},{"filePath":"100","messages":"101","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"51"},{"filePath":"102","messages":"103","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"75"},"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/App.js",["104","105"],"import \"./App.css\";\nimport Header from \"./components/Header/Header\";\nimport { Route, Switch } from \"react-router-dom\";\nimport MainContainer from \"./components/MainContainer/MainContainer\";\nimport Paper from \"@material-ui/core/Paper\";\nimport { makeStyles, ThemeProvider } from \"@material-ui/core/styles\";\nimport Logo from \"./components/Logo/Logo\";\nimport theme from \"./theme\";\nimport NewStoryContainer from \"./components/NewStoryContainer/NewStoryContainer\";\nimport NewNewsletterContainer from \"./components/NewNewsletterContainer/NewNewsletterContainer\";\nimport { useContext, useEffect } from \"react\";\nimport { StoriesContext } from \"./context/StoriesContext\";\nimport NotFoundContainer from \"./components/NotFoundContainer/NotFoundContainer\";\nimport StoryContainer from \"./components/StoryContainer/StoryContainer\";\nimport { NewslettersContext } from \"./context/NewslettersContext\";\nimport NewsletterContainer from \"./components/NewsletterContainer/NewsletterContainer\";\nimport { fetchStories, fetchNewsletters } from \"./utils/fetches\";\n\nconst useStyles = makeStyles({\n container: {\n maxWidth: 800,\n margin: \"50px auto\",\n padding: \"30px 30px 40px\",\n borderRadius: 20,\n },\n});\n\nfunction App() {\n const { container } = useStyles();\n const [stories, setStories] = useContext(StoriesContext);\n const [newsletters, setNewsletters] = useContext(NewslettersContext);\n\n useEffect(() => {\n fetchStories().then((result) => setStories(result));\n fetchNewsletters().then((result) => setNewsletters(result));\n }, [setStories, setNewsletters]);\n\n return (\n <ThemeProvider theme={theme}>\n <div className=\"App\">\n <Header />\n\n <Paper elevation={3} className={container}>\n <Logo size={\"50%\"} />\n\n <Switch>\n <Route path=\"/new-story\" exact component={NewStoryContainer} />\n <Route\n path=\"/new-newsletter\"\n exact\n component={NewNewsletterContainer}\n />\n <Route path=\"/stories/:id\" component={StoryContainer} />\n <Route\n path=\"/edit-story/:id\"\n component={() => <NewStoryContainer edit />}\n />\n <Route path=\"/newsletters/:id\" component={NewsletterContainer} />\n <Route path=\"/\" exact component={MainContainer} />\n <Route path=\"*\" component={NotFoundContainer} />\n </Switch>\n </Paper>\n </div>\n </ThemeProvider>\n );\n}\n\nexport default App;\n",["106","107"],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/index.js",[],["108","109"],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/MainContainer/MainContainer.js",["110","111"],"import React, { useContext } from \"react\";\nimport { makeStyles } from \"@material-ui/core/styles\";\nimport DefaultButton from \"../DefaultButton/DefaultButton\";\nimport { Typography } from \"@material-ui/core\";\nimport { StoriesContext } from \"../../context/StoriesContext\";\nimport { Link } from \"react-router-dom\";\nimport { NewslettersContext } from \"../../context/NewslettersContext\";\nimport { getFormattedDate } from \"../../utils/helperFns\";\n\nconst useStyles = makeStyles((theme) => ({\n container: { marginTop: 10 },\n buttonsContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n },\n titleTable: {\n textAlign: \"left\",\n \"& td\": { padding: \"3px 5px\" },\n },\n}));\n\nexport default function MainContainer() {\n const { container, buttonsContainer, titleTable } = useStyles();\n const [newsletters, setNewsletters] = useContext(NewslettersContext);\n const [stories, setStories] = useContext(StoriesContext);\n\n const getStoryTitles = () => {\n if (stories && stories.length) {\n return stories.map(({ id, title, formatted_date }) => {\n return (\n <tr key={id}>\n <td>\n <Link to={`/stories/${id}`}>{title}</Link>\n </td>\n <td>\n <Typography variant=\"caption\" display=\"block\">\n {getFormattedDate(formatted_date)}\n </Typography>\n </td>\n </tr>\n );\n });\n }\n };\n const getPublishedNewsLetterTitles = () => {\n if (newsletters && newsletters.length) {\n return newsletters.map(({ id, title, formatted_date }) => {\n return (\n <tr key={id}>\n <td>\n <Link to={`/newsletters/${id}`}>{title}</Link>\n </td>\n <td>\n <Typography variant=\"caption\" display=\"block\">\n {getFormattedDate(formatted_date)}\n </Typography>\n </td>\n </tr>\n );\n });\n }\n };\n\n return (\n <section className={container}>\n <div className={buttonsContainer}>\n <DefaultButton text={\"Add Story\"} to={\"/new-story\"} />\n <DefaultButton text={\"Publish Newsletter\"} to={\"/new-newsletter\"} />\n </div>\n <div>\n <Typography align=\"center\" color=\"primary\" variant=\"h6\">\n My Stories\n </Typography>\n <table className={titleTable}>{getStoryTitles()}</table>\n </div>\n <br />\n <hr />\n\n <div>\n <Typography align=\"center\" color=\"primary\" variant=\"h6\">\n Published Newsletters\n </Typography>\n <table className={titleTable}>{getPublishedNewsLetterTitles()}</table>\n </div>\n </section>\n );\n}\n","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Header/Header.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Logo/Logo.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/DefaultButton/DefaultButton.js",[],["112","113"],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/NewStoryContainer/NewStoryContainer.js",["114"],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/DefaultTextField/DefaultTextField.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Story/Story.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/theme.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/context/StoriesContext.js",[],["115","116"],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/utils/constants.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/NotFoundContainer/NotFoundContainer.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/StoryContainer/StoryContainer.js",["117"],"import React, { useContext, useEffect, useState } from \"react\";\nimport { useParams, useHistory } from \"react-router-dom\";\nimport DefaultButton from \"../DefaultButton/DefaultButton\";\nimport Story from \"../Story/Story\";\nimport { StoriesContext } from \"../../context/StoriesContext\";\nimport { deleteStory, fetchStory } from \"../../utils/fetches\";\n\nexport default function StoryContainer() {\n const { id } = useParams();\n const history = useHistory();\n\n const [story, setStory] = useState(null);\n const [stories, setStories] = useContext(StoriesContext);\n\n useEffect(() => {\n fetchStory(id).then((data) => {\n if (data) {\n data.error ? console.log(data.error) : setStory(data);\n }\n });\n }, [setStory, id]);\n\n const displayStory = () => {\n if (story) {\n const {\n title,\n tag: { name: tag },\n html: content,\n } = story;\n\n return <Story {...{ title, tag, content }} />;\n }\n };\n\n const handleDelete = async () => {\n if (\n window.confirm(\"Are you sure you want to permanently delete this story?\")\n ) {\n const data = await deleteStory(id);\n if (data) {\n data.error\n ? console.log(data.error)\n : setStories((prevStories) =>\n prevStories.filter((s) => s.id !== parseInt(id))\n );\n }\n\n history.push(\"/\");\n }\n };\n\n return (\n <section style={{ textAlign: \"right\" }}>\n <DefaultButton text=\"Edit\" to={`/edit-story/${id}`} />\n {\" \"}\n <DefaultButton text=\"Delete\" onClick={handleDelete} />\n {displayStory()}\n </section>\n );\n}\n","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/NewNewsletterContainer/NewNewsletterContainer.js",["118"],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/RichTextEditor/RichTextEditor.js",["119"],"import React from \"react\";\nimport { Editor } from \"@tinymce/tinymce-react\";\nimport sanitizeHtml from \"sanitize-html\";\n\nexport default function RichTextEditor({ value, setStateCallback, size }) {\n const handleEditorChange = (content) => {\n const sanitizedHtml = sanitizeHtml(content, {\n allowedTags: false,\n allowedAttributes: false,\n });\n setStateCallback(sanitizedHtml);\n };\n\n return (\n <section style={{ margin: 15 }}>\n <Editor\n {...{\n apiKey: process.env.REACT_APP_TINY_MCE_KEY,\n initialValue: value,\n init: {\n height: size || 300,\n menubar: false,\n plugins: [\n \"advlist autolink lists link image charmap print preview anchor\",\n \"searchreplace visualblocks code fullscreen\",\n \"insertdatetime media table paste code help wordcount\",\n ],\n toolbar:\n \"undo redo | formatselect | bold italic backcolor | \\\n alignleft aligncenter alignright alignjustify | \\\n bullist numlist outdent indent | removeformat | help\",\n },\n onEditorChange: handleEditorChange,\n }}\n />\n </section>\n );\n}\n","/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/DefaultDatePicker/DefaultDatePicker.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/context/NewslettersContext.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Newsletter/Newsletter.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/Newsletter/StoryCard/StoryCard.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/components/NewsletterContainer/NewsletterContainer.js",["120"],"import React, { useContext, useEffect, useState } from \"react\";\nimport { useHistory, useParams } from \"react-router-dom\";\nimport { NewslettersContext } from \"../../context/NewslettersContext\";\nimport { fetchNewsletter, deleteNewsletter } from \"../../utils/fetches\";\nimport DefaultButton from \"../DefaultButton/DefaultButton\";\nimport Newsletter from \"../Newsletter/Newsletter\";\n\nexport default function NewsletterContainer() {\n const { id } = useParams();\n const history = useHistory();\n\n const [newsletter, setNewsletter] = useState(null);\n const [newsletters, setNewsletters] = useContext(NewslettersContext);\n\n useEffect(() => {\n fetchNewsletter(id).then((data) => {\n if (data) {\n data.error ? console.log(data.error) : setNewsletter(data);\n }\n });\n }, [setNewsletter, id]);\n\n const displayNewsletter = () => {\n if (newsletter) {\n const {\n title,\n description,\n formatted_date: date,\n stories: storiesToPublish,\n } = newsletter;\n\n return <Newsletter {...{ title, description, date, storiesToPublish }} />;\n }\n };\n\n const handleDelete = async () => {\n if (\n window.confirm(\n \"Are you sure you want to permanently delete this newsletter?\"\n )\n ) {\n const data = await deleteNewsletter(id);\n if (data) {\n data.error\n ? console.log(data.error)\n : setNewsletters((prevNewsletters) =>\n prevNewsletters.filter((n) => n.id !== parseInt(id))\n );\n }\n\n history.push(\"/\");\n }\n };\n\n return (\n <section style={{ textAlign: \"right\" }}>\n <DefaultButton text=\"Delete\" onClick={handleDelete} />\n {displayNewsletter()}\n </section>\n );\n}\n",["121","122"],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/utils/fetches.js",[],"/Users/anhvuong/Desktop/Code/afternoon-roast-frontend/src/utils/helperFns.js",[],{"ruleId":"123","severity":1,"message":"124","line":30,"column":10,"nodeType":"125","messageId":"126","endLine":30,"endColumn":17},{"ruleId":"123","severity":1,"message":"127","line":31,"column":10,"nodeType":"125","messageId":"126","endLine":31,"endColumn":21},{"ruleId":"128","replacedBy":"129"},{"ruleId":"130","replacedBy":"131"},{"ruleId":"128","replacedBy":"132"},{"ruleId":"130","replacedBy":"133"},{"ruleId":"123","severity":1,"message":"134","line":24,"column":23,"nodeType":"125","messageId":"126","endLine":24,"endColumn":37},{"ruleId":"123","severity":1,"message":"135","line":25,"column":19,"nodeType":"125","messageId":"126","endLine":25,"endColumn":29},{"ruleId":"128","replacedBy":"136"},{"ruleId":"130","replacedBy":"137"},{"ruleId":"123","severity":1,"message":"124","line":13,"column":10,"nodeType":"125","messageId":"126","endLine":13,"endColumn":17},{"ruleId":"128","replacedBy":"138"},{"ruleId":"130","replacedBy":"139"},{"ruleId":"123","severity":1,"message":"124","line":13,"column":10,"nodeType":"125","messageId":"126","endLine":13,"endColumn":17},{"ruleId":"123","severity":1,"message":"135","line":16,"column":19,"nodeType":"125","messageId":"126","endLine":16,"endColumn":29},{"ruleId":"140","severity":1,"message":"141","line":29,"column":15,"nodeType":"142","messageId":"143","endLine":31,"endColumn":64},{"ruleId":"123","severity":1,"message":"127","line":13,"column":10,"nodeType":"125","messageId":"126","endLine":13,"endColumn":21},{"ruleId":"128","replacedBy":"144"},{"ruleId":"130","replacedBy":"145"},"no-unused-vars","'stories' is assigned a value but never used.","Identifier","unusedVar","'newsletters' is assigned a value but never used.","no-native-reassign",["146"],"no-negated-in-lhs",["147"],["146"],["147"],"'setNewsletters' is assigned a value but never used.","'setStories' is assigned a value but never used.",["146"],["147"],["146"],["147"],"no-multi-str","Multiline support is limited to browsers supporting ES5 only.","Literal","multilineString",["146"],["147"],"no-global-assign","no-unsafe-negation"]