-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 10.4 KB
/
.eslintcache
1
[{"/Users/filippobarcellos/Desktop/github_explorer/src/index.tsx":"1","/Users/filippobarcellos/Desktop/github_explorer/src/App.tsx":"2","/Users/filippobarcellos/Desktop/github_explorer/src/routes/index.tsx":"3","/Users/filippobarcellos/Desktop/github_explorer/src/Pages/Dashboard/index.tsx":"4","/Users/filippobarcellos/Desktop/github_explorer/src/Pages/Dashboard/styles.ts":"5","/Users/filippobarcellos/Desktop/github_explorer/src/styles/global.ts":"6","/Users/filippobarcellos/Desktop/github_explorer/src/services/api.ts":"7","/Users/filippobarcellos/Desktop/github_explorer/src/Pages/User/index.tsx":"8","/Users/filippobarcellos/Desktop/github_explorer/src/components/Header/index.tsx":"9","/Users/filippobarcellos/Desktop/github_explorer/src/components/Header/styles.ts":"10","/Users/filippobarcellos/Desktop/github_explorer/src/Pages/User/styles.ts":"11","/Users/filippobarcellos/Desktop/github_explorer/src/components/Pagination/index.tsx":"12","/Users/filippobarcellos/Desktop/github_explorer/src/components/Pagination/styles.ts":"13"},{"size":268,"mtime":1612126252853,"results":"14","hashOfConfig":"15"},{"size":201,"mtime":1612116686330,"results":"16","hashOfConfig":"15"},{"size":451,"mtime":1612266593069,"results":"17","hashOfConfig":"15"},{"size":2027,"mtime":1612264242968,"results":"18","hashOfConfig":"15"},{"size":1757,"mtime":1612177728984,"results":"19","hashOfConfig":"15"},{"size":548,"mtime":1612212895481,"results":"20","hashOfConfig":"15"},{"size":115,"mtime":1612124394420,"results":"21","hashOfConfig":"15"},{"size":2685,"mtime":1612264861794,"results":"22","hashOfConfig":"15"},{"size":290,"mtime":1612179710763,"results":"23","hashOfConfig":"15"},{"size":372,"mtime":1612179917464,"results":"24","hashOfConfig":"15"},{"size":1580,"mtime":1612181128800,"results":"25","hashOfConfig":"15"},{"size":1995,"mtime":1612262185729,"results":"26","hashOfConfig":"15"},{"size":1026,"mtime":1612218869681,"results":"27","hashOfConfig":"15"},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"1a1quhy",{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"43","messages":"44","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"45","usedDeprecatedRules":"30"},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"52","messages":"53","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"54","usedDeprecatedRules":"30"},{"filePath":"55","messages":"56","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"57"},"/Users/filippobarcellos/Desktop/github_explorer/src/index.tsx",[],["58","59"],"/Users/filippobarcellos/Desktop/github_explorer/src/App.tsx",[],"/Users/filippobarcellos/Desktop/github_explorer/src/routes/index.tsx",[],"/Users/filippobarcellos/Desktop/github_explorer/src/Pages/Dashboard/index.tsx",[],"/Users/filippobarcellos/Desktop/github_explorer/src/Pages/Dashboard/styles.ts",[],"/Users/filippobarcellos/Desktop/github_explorer/src/styles/global.ts",[],"/Users/filippobarcellos/Desktop/github_explorer/src/services/api.ts",[],"/Users/filippobarcellos/Desktop/github_explorer/src/Pages/User/index.tsx",["60"],"import React, { useCallback, useEffect, useState } from 'react';\nimport { Link, useParams } from 'react-router-dom';\nimport { FiChevronLeft, FiChevronRight } from 'react-icons/fi'\nimport Header from '../../components/Header';\nimport api from '../../services/api';\n\nimport { UserInfo, Repositories } from './styles';\nimport Pagination from '../../components/Pagination';\n\ninterface UserParams {\n user: string;\n}\n\ninterface User {\n id: number,\n avatar_url: string,\n login: string,\n bio: string,\n followers: number,\n following: number,\n public_repos: number,\n}\n\ninterface Repository {\n id: number,\n name: string,\n html_url: string,\n}\n\nconst User: React.FC = () => {\n const [userInfo, setUserInfo] = useState<User | null>();\n const [repositories, setRepositories] = useState<Repository[]>([]);\n const [currentPage, setCurrentPage] = useState(1);\n\n const { user } = useParams<UserParams>();\n\n useEffect(() => {\n api.get(`users/${user}`).then(response => setUserInfo(response.data));\n api.get(`users/${user}/repos?page=${currentPage}&per_page=10`).then(response => setRepositories(response.data));\n }, [user, currentPage])\n\n const onPageChange = useCallback((page) => {\n setCurrentPage(page);\n }, []);\n\n return (\n <>\n <Header>\n <Link to=\"/\">\n <FiChevronLeft size={16} />\n Go Back\n </Link>\n </Header>\n\n {userInfo && (\n <UserInfo>\n <header>\n <img src={userInfo.avatar_url} alt={userInfo.login} />\n <div>\n <strong>{userInfo.login}</strong>\n <span>{userInfo.bio}</span>\n </div>\n </header>\n\n <ul>\n <li>\n <strong>{userInfo.followers}</strong>\n <span>followers</span>\n </li>\n <li>\n <strong>{userInfo.following}</strong>\n <span>following</span>\n </li>\n <li>\n <strong>{userInfo.public_repos}</strong>\n <span>repositories</span>\n </li>\n </ul>\n </UserInfo>\n )}\n \n {repositories && (\n <Repositories>\n {repositories.map(repo => (\n <a href={repo.html_url} key={repo.id}>\n <div>\n <strong>{repo.name}</strong>\n </div>\n <FiChevronRight size={20} />\n </a>\n ))}\n </Repositories>\n )}\n\n {userInfo && repositories && (\n <Pagination \n totalItems={userInfo.public_repos} \n currentPage={currentPage} \n onPageChange={onPageChange}\n itemsPerPage={10} \n /> \n )}\n </>\n )\n}\n\nexport default User;","/Users/filippobarcellos/Desktop/github_explorer/src/components/Header/index.tsx",[],"/Users/filippobarcellos/Desktop/github_explorer/src/components/Header/styles.ts",[],"/Users/filippobarcellos/Desktop/github_explorer/src/Pages/User/styles.ts",[],"/Users/filippobarcellos/Desktop/github_explorer/src/components/Pagination/index.tsx",["61","62"],"import React, { useState } from 'react';\nimport { FiChevronLeft, FiChevronRight } from 'react-icons/fi';\n\nimport { Container, Page } from './styles';\n\ninterface IProps {\n totalItems: number,\n currentPage: number,\n itemsPerPage: number,\n onPageChange: (page: number) => void,\n}\n\nconst Pagination = ({ totalItems, currentPage, onPageChange, itemsPerPage }: IProps) => {\n const [maxNumberPagesShowing, setMaxNumberPagesShowing] = useState(5);\n const [maxNumberLimit, setMaxNumberLimit] = useState(5);\n const [minNumberLimit, setMinNumberLimit] = useState(1);\n\n\n const pages = Math.ceil(totalItems / itemsPerPage);\n \n const pagesArr = Array.from(Array(pages), (_,x) => x + 1);\n\n const handleNextButton = () => {\n if (currentPage >= pages) {\n onPageChange(currentPage);\n } else {\n onPageChange(currentPage += 1);\n }\n\n if (currentPage > maxNumberLimit && !(currentPage >= pages)) {\n setMaxNumberLimit(maxNumberLimit + maxNumberPagesShowing);\n setMinNumberLimit( minNumberLimit + maxNumberPagesShowing);\n }\n }\n\n const handlePrevButton = () => {\n if (currentPage <= 1) {\n onPageChange(1);\n } else {\n onPageChange(currentPage -+ 1);\n }\n\n if (currentPage <= minNumberLimit && !(currentPage <=1) ) {\n setMaxNumberLimit(maxNumberLimit - maxNumberPagesShowing);\n setMinNumberLimit( minNumberLimit - maxNumberPagesShowing);\n }\n }\n\n return (\n <Container>\n \n <span onClick={() => handlePrevButton()}>\n <FiChevronLeft size={16} />\n </span>\n \n <ul>\n {pagesArr.map(page => {\n if (page <= maxNumberLimit && page >= minNumberLimit) {\n return <Page key={page} active={currentPage === page}>\n <button onClick={() => onPageChange(page)}>{page}</button>\n </Page>\n }\n })}\n </ul>\n\n <span onClick={() => handleNextButton()}>\n <FiChevronRight size={16} />\n </span>\n </Container>\n )\n}\n\nexport default Pagination;","/Users/filippobarcellos/Desktop/github_explorer/src/components/Pagination/styles.ts",[],["63","64"],{"ruleId":"65","replacedBy":"66"},{"ruleId":"67","replacedBy":"68"},{"ruleId":"69","severity":1,"message":"70","line":30,"column":7,"nodeType":"71","messageId":"72","endLine":30,"endColumn":21},{"ruleId":"73","severity":1,"message":"74","line":14,"column":33,"nodeType":"71","messageId":"75","endLine":14,"endColumn":57},{"ruleId":"76","severity":1,"message":"77","line":57,"column":28,"nodeType":"78","messageId":"79","endLine":57,"endColumn":30},{"ruleId":"65","replacedBy":"80"},{"ruleId":"67","replacedBy":"81"},"no-native-reassign",["82"],"no-negated-in-lhs",["83"],"@typescript-eslint/no-redeclare","'User' is already defined.","Identifier","redeclared","@typescript-eslint/no-unused-vars","'setMaxNumberPagesShowing' is assigned a value but never used.","unusedVar","array-callback-return","Array.prototype.map() expects a value to be returned at the end of arrow function.","ArrowFunctionExpression","expectedAtEnd",["82"],["83"],"no-global-assign","no-unsafe-negation"]