-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintcache
1 lines (1 loc) · 6.48 KB
/
.eslintcache
1
[{"/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/index.js":"1","/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/reportWebVitals.js":"2","/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/App.js":"3","/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/article/index.js":"4","/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/components/articleList.jsx":"5","/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/components/post.jsx":"6","/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/components/header.jsx":"7"},{"size":500,"mtime":1612002733213,"results":"8","hashOfConfig":"9"},{"size":362,"mtime":1612002733213,"results":"10","hashOfConfig":"9"},{"size":938,"mtime":1679806355426,"results":"11","hashOfConfig":"9"},{"size":200,"mtime":1676788217652,"results":"12","hashOfConfig":"9"},{"size":572,"mtime":1676787834828,"results":"13","hashOfConfig":"9"},{"size":3169,"mtime":1679806369100,"results":"14","hashOfConfig":"9"},{"size":1576,"mtime":1679805997652,"results":"15","hashOfConfig":"9"},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},"1oonjeq",{"filePath":"19","messages":"20","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"29"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},"/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/index.js",[],["32","33"],"/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/reportWebVitals.js",[],"/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/App.js",[],"/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/article/index.js",[],"/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/components/articleList.jsx",[],"/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/components/post.jsx",["34"],"import React, { useEffect, useState } from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport matter from \"gray-matter\";\n\nconst Post = ({ slug }) => {\n const [blog, setBlog] = useState(null);\n\n const generateData = async () => {\n const title = slug;\n const file = await import(`../article/${title}.md`);\n const response = await fetch(file.default)\n .then((res) => res.text())\n .then((text) => text);\n const write = matter(response);\n setBlog(write);\n };\n\n useEffect(() => {\n generateData();\n }, []);\n\n const RenderData = ({ content }) => {\n if (content) {\n return (\n <div>\n <div className=\"\">\n <span className=\"text-black-400 font-thin dark:text-gray-200\">\n {content.data.date}\n </span>\n <h1 className=\"text-3xl text-black-500 font-bold capitalize dark:text-gray-200\">\n {content.data.title}\n </h1>\n </div>\n <div className=\"markdown-body dark:text-gray-200\">\n <ReactMarkdown source={content.content} />\n </div>\n </div>\n );\n } else {\n return (\n <h1 className=\"text-black-400 font-thin dark:text-gray-200\">\n loading...\n </h1>\n );\n }\n };\n\n return (\n <>\n <div>\n <div className=\"container mx-auto max-w-screen-lg pb-20\">\n <div className=\"markdown-body pt-40 px-5\">\n <RenderData content={blog} />\n </div>\n </div>\n </div>\n </>\n );\n};\n\n// class Post extends React.Component {\n// constructor(props) {\n// super(props);\n// this.state = {\n// blog: null,\n// };\n// }\n// async generateData() {\n// const title = this.props.slug;\n// const file = await import(`../article/${title}.md`);\n// const response = await fetch(file.default)\n// .then((res) => res.text())\n// .then((text) => text);\n// const write = matter(response);\n// this.setState({\n// blog: write,\n// });\n// }\n\n// renderData(content) {\n// if (content) {\n// return (\n// <div>\n// <div className=\"pt-10\">\n// <span className=\"text-black-400 font-thin dark:text-gray-200\">\n// {content.data.date}\n// </span>\n// <h1 className=\"text-3xl text-black-500 font-bold capitalize dark:text-gray-200\">\n// {content.data.title}\n// </h1>\n// </div>\n// <div className=\"markdown-body dark:text-gray-200\">\n// <ReactMarkdown source={content.content} />\n// </div>\n// </div>\n// );\n// } else {\n// return (\n// <h1 className=\"text-black-400 font-thin dark:text-gray-200\">\n// loading...\n// </h1>\n// );\n// }\n// }\n\n// componentDidMount() {\n// this.generateData();\n// }\n\n// render() {\n// return (\n// <div>\n// <div className=\"container mx-auto max-w-screen-lg pb-20\">\n// <div className=\"markdown-body mt-20\">\n// {this.renderData(this.state.blog)}\n// </div>\n// </div>\n// </div>\n// );\n// }\n// }\n\nexport default Post;\n","/Users/heruhartanto/Documents/labs/goheru-markdown-blog-react/src/components/header.jsx",[],{"ruleId":"35","replacedBy":"36"},{"ruleId":"37","replacedBy":"38"},{"ruleId":"39","severity":1,"message":"40","line":20,"column":6,"nodeType":"41","endLine":20,"endColumn":8,"suggestions":"42"},"no-native-reassign",["43"],"no-negated-in-lhs",["44"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'generateData'. Either include it or remove the dependency array.","ArrayExpression",["45"],"no-global-assign","no-unsafe-negation",{"desc":"46","fix":"47"},"Update the dependencies array to be: [generateData]",{"range":"48","text":"49"},[537,539],"[generateData]"]