forked from ganeshmani/redux-toolkit-user-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 21.1 KB
/
.eslintcache
1
[{"C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\index.js":"1","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\app\\store.js":"2","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\features\\User\\Signup.js":"3","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\features\\User\\Login.js":"4","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\App.js":"5","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\features\\User\\Dashboard.js":"6","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\features\\User\\UserSlice.js":"7","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\helpers\\PrivateRoute.js":"8"},{"size":714,"mtime":1612011437014,"results":"9","hashOfConfig":"10"},{"size":197,"mtime":1612017911942,"results":"11","hashOfConfig":"10"},{"size":6120,"mtime":1612022095681,"results":"12","hashOfConfig":"10"},{"size":5156,"mtime":1612022156577,"results":"13","hashOfConfig":"10"},{"size":687,"mtime":1612017755099,"results":"14","hashOfConfig":"10"},{"size":1418,"mtime":1612026863840,"results":"15","hashOfConfig":"10"},{"size":4747,"mtime":1612026888056,"results":"16","hashOfConfig":"10"},{"size":419,"mtime":1612017646954,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"20","usedDeprecatedRules":"21"},"8mokft",{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"26"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"29"},{"filePath":"30","messages":"31","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"32"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"35","usedDeprecatedRules":"21"},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\index.js",["40"],"import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './index.css';\r\nimport App from './App';\r\nimport store from './app/store';\r\nimport { Provider } from 'react-redux';\r\nimport * as serviceWorker from './serviceWorker';\r\nimport toast, { Toaster } from 'react-hot-toast';\r\n\r\nReactDOM.render(\r\n <React.StrictMode>\r\n <Provider store={store}>\r\n <App />\r\n <Toaster />\r\n </Provider>\r\n </React.StrictMode>,\r\n document.getElementById('root')\r\n);\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n",["41","42"],"C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\app\\store.js",[],"C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\features\\User\\Signup.js",["43","44","45"],"import React, { Fragment, useEffect } from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport { useForm } from 'react-hook-form';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { signupUser, userSelector, clearState } from './UserSlice';\r\nimport { useHistory } from 'react-router-dom';\r\nimport toast from 'react-hot-toast';\r\n\r\nconst Signup = () => {\r\n const dispatch = useDispatch();\r\n const { register, errors, handleSubmit } = useForm();\r\n const history = useHistory();\r\n\r\n const { isFetching, isSuccess, isError, errorMessage } = useSelector(\r\n userSelector\r\n );\r\n const onSubmit = (data) => {\r\n dispatch(signupUser(data));\r\n };\r\n\r\n useEffect(() => {\r\n return () => {\r\n dispatch(clearState());\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (isSuccess) {\r\n dispatch(clearState());\r\n history.push('/');\r\n }\r\n\r\n if (isError) {\r\n toast.error(errorMessage);\r\n dispatch(clearState());\r\n }\r\n }, [isSuccess, isError]);\r\n\r\n return (\r\n <Fragment>\r\n <div className=\"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8\">\r\n <div class=\"sm:mx-auto sm:w-full sm:max-w-md\">\r\n <h2 class=\"mt-6 text-center text-3xl font-extrabold text-gray-900\">\r\n Sign Up to your account\r\n </h2>\r\n </div>\r\n <div className=\"mt-8 sm:mx-auto sm:w-full sm:max-w-md\">\r\n <div className=\"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10\">\r\n <form\r\n className=\"space-y-6\"\r\n onSubmit={handleSubmit(onSubmit)}\r\n method=\"POST\"\r\n >\r\n <div>\r\n <label\r\n for=\"name\"\r\n className=\"block text-sm font-medium text-gray-700\"\r\n >\r\n Name\r\n </label>\r\n <div className=\"mt-1\">\r\n <input\r\n id=\"name\"\r\n name=\"name\"\r\n type=\"text\"\r\n ref={register({ required: true })}\r\n autocomplete=\"name\"\r\n required\r\n className=\"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm\"\r\n />\r\n </div>\r\n </div>\r\n <div>\r\n <label\r\n for=\"email\"\r\n className=\"block text-sm font-medium text-gray-700\"\r\n >\r\n Email address\r\n </label>\r\n <div className=\"mt-1\">\r\n <input\r\n id=\"email\"\r\n name=\"email\"\r\n type=\"email\"\r\n autocomplete=\"email\"\r\n required\r\n ref={register({\r\n pattern: /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$/i,\r\n })}\r\n className=\"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div>\r\n <label\r\n for=\"password\"\r\n className=\"block text-sm font-medium text-gray-700\"\r\n >\r\n Password\r\n </label>\r\n <div className=\"mt-1\">\r\n <input\r\n id=\"password\"\r\n name=\"password\"\r\n type=\"password\"\r\n ref={register({ required: true })}\r\n autocomplete=\"current-password\"\r\n required\r\n className=\"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div>\r\n <button\r\n type=\"submit\"\r\n className=\"w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500\"\r\n >\r\n {isFetching ? (\r\n <Fragment>\r\n <svg\r\n class=\"animate-spin -ml-1 mr-3 h-5 w-5 text-white\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n >\r\n <circle\r\n class=\"opacity-25\"\r\n cx=\"12\"\r\n cy=\"12\"\r\n r=\"10\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"4\"\r\n ></circle>\r\n <path\r\n class=\"opacity-75\"\r\n fill=\"currentColor\"\r\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\r\n ></path>\r\n </svg>\r\n\r\n <p>Signing up</p>\r\n </Fragment>\r\n ) : (\r\n <p> Sign up</p>\r\n )}\r\n </button>\r\n </div>\r\n </form>\r\n <div class=\"mt-6\">\r\n <div class=\"relative\">\r\n <div class=\"relative flex justify-center text-sm\">\r\n <span class=\"px-2 bg-white text-gray-500\">\r\n Or <Link to=\"login\"> Login</Link>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </Fragment>\r\n );\r\n};\r\n\r\nexport default Signup;\r\n","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\features\\User\\Login.js",["46","47","48","49"],"import React, { Fragment, useEffect } from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport { useForm } from 'react-hook-form';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { loginUser, userSelector, clearState } from './UserSlice';\r\nimport toast from 'react-hot-toast';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nconst Login = ({}) => {\r\n const dispatch = useDispatch();\r\n const history = useHistory();\r\n const { register, errors, handleSubmit } = useForm();\r\n const { isFetching, isSuccess, isError, errorMessage } = useSelector(\r\n userSelector\r\n );\r\n const onSubmit = (data) => {\r\n dispatch(loginUser(data));\r\n };\r\n\r\n useEffect(() => {\r\n return () => {\r\n dispatch(clearState());\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (isError) {\r\n toast.error(errorMessage);\r\n dispatch(clearState());\r\n }\r\n\r\n if (isSuccess) {\r\n dispatch(clearState());\r\n history.push('/');\r\n }\r\n }, [isError, isSuccess]);\r\n\r\n return (\r\n <Fragment>\r\n <div className=\"min-h-screen bg-gray-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8\">\r\n <div class=\"sm:mx-auto sm:w-full sm:max-w-md\">\r\n <h2 class=\"mt-6 text-center text-3xl font-extrabold text-gray-900\">\r\n Sign in to your account\r\n </h2>\r\n </div>\r\n <div className=\"mt-8 sm:mx-auto sm:w-full sm:max-w-md\">\r\n <div className=\"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10\">\r\n <form\r\n className=\"space-y-6\"\r\n onSubmit={handleSubmit(onSubmit)}\r\n method=\"POST\"\r\n >\r\n <div>\r\n <label\r\n for=\"email\"\r\n className=\"block text-sm font-medium text-gray-700\"\r\n >\r\n Email address\r\n </label>\r\n <div className=\"mt-1\">\r\n <input\r\n id=\"email\"\r\n name=\"email\"\r\n type=\"email\"\r\n autoComplete=\"email\"\r\n ref={register({\r\n pattern: /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$/i,\r\n })}\r\n required\r\n className=\"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div>\r\n <label\r\n for=\"password\"\r\n className=\"block text-sm font-medium text-gray-700\"\r\n >\r\n Password\r\n </label>\r\n <div className=\"mt-1\">\r\n <input\r\n id=\"password\"\r\n name=\"password\"\r\n type=\"password\"\r\n ref={register({ required: true })}\r\n autoComplete=\"current-password\"\r\n required\r\n className=\"appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <div>\r\n <button\r\n type=\"submit\"\r\n className=\"w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500\"\r\n >\r\n {isFetching ? (\r\n <svg\r\n class=\"animate-spin -ml-1 mr-3 h-5 w-5 text-white\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n >\r\n <circle\r\n class=\"opacity-25\"\r\n cx=\"12\"\r\n cy=\"12\"\r\n r=\"10\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"4\"\r\n ></circle>\r\n <path\r\n class=\"opacity-75\"\r\n fill=\"currentColor\"\r\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\r\n ></path>\r\n </svg>\r\n ) : null}\r\n Sign in\r\n </button>\r\n </div>\r\n </form>\r\n <div class=\"mt-6\">\r\n <div class=\"relative\">\r\n <div class=\"relative flex justify-center text-sm\">\r\n <span class=\"px-2 bg-white text-gray-500\">\r\n Or <Link to=\"signup\"> Signup</Link>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </Fragment>\r\n );\r\n};\r\n\r\nexport default Login;\r\n","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\App.js",["50"],"import React from 'react';\r\nimport './App.css';\r\nimport { BrowserRouter as Router, Switch, Route, Link } from 'react-router-dom';\r\nimport Login from './features/User/Login';\r\nimport Signup from './features/User/Signup';\r\nimport Dashboard from './features/User/Dashboard';\r\nimport { PrivateRoute } from './helpers/PrivateRoute';\r\n\r\nfunction App() {\r\n return (\r\n <div className=\"App\">\r\n <Router>\r\n <Switch>\r\n <Route exact component={Login} path=\"/login\" />\r\n <Route exact component={Signup} path=\"/signup\" />\r\n <PrivateRoute exact component={Dashboard} path=\"/\" />\r\n </Switch>\r\n </Router>\r\n </div>\r\n );\r\n}\r\n\r\nexport default App;\r\n","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\features\\User\\Dashboard.js",["51","52","53"],"import React, { Fragment, useEffect } from 'react';\r\nimport { useSelector, useDispatch } from 'react-redux';\r\nimport { userSelector, fetchUserBytoken, clearState } from './UserSlice';\r\nimport Loader from 'react-loader-spinner';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nconst Dashboard = () => {\r\n const history = useHistory();\r\n\r\n const dispatch = useDispatch();\r\n const { isFetching, isError } = useSelector(userSelector);\r\n useEffect(() => {\r\n dispatch(fetchUserBytoken({ token: localStorage.getItem('token') }));\r\n }, []);\r\n\r\n const { username, email } = useSelector(userSelector);\r\n\r\n useEffect(() => {\r\n if (isError) {\r\n dispatch(clearState());\r\n history.push('/login');\r\n }\r\n }, [isError]);\r\n\r\n const onLogOut = () => {\r\n localStorage.removeItem('token');\r\n\r\n history.push('/login');\r\n };\r\n\r\n return (\r\n <div className=\"container mx-auto\">\r\n {isFetching ? (\r\n <Loader type=\"Puff\" color=\"#00BFFF\" height={100} width={100} />\r\n ) : (\r\n <Fragment>\r\n <div className=\"container mx-auto\">\r\n Welcome back <h3>{username}</h3>\r\n </div>\r\n\r\n <button\r\n onClick={onLogOut}\r\n className=\"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded\"\r\n >\r\n Log Out\r\n </button>\r\n </Fragment>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default Dashboard;\r\n","C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\features\\User\\UserSlice.js",[],"C:\\Users\\DELL\\Desktop\\learning-projects\\redux-user-flow\\src\\helpers\\PrivateRoute.js",[],{"ruleId":"54","severity":1,"message":"55","line":8,"column":8,"nodeType":"56","messageId":"57","endLine":8,"endColumn":13},{"ruleId":"58","replacedBy":"59"},{"ruleId":"60","replacedBy":"61"},{"ruleId":"54","severity":1,"message":"62","line":11,"column":21,"nodeType":"56","messageId":"57","endLine":11,"endColumn":27},{"ruleId":"63","severity":1,"message":"64","line":25,"column":6,"nodeType":"65","endLine":25,"endColumn":8,"suggestions":"66"},{"ruleId":"63","severity":1,"message":"67","line":37,"column":6,"nodeType":"65","endLine":37,"endColumn":26,"suggestions":"68"},{"ruleId":"69","severity":1,"message":"70","line":9,"column":16,"nodeType":"71","messageId":"72","endLine":9,"endColumn":18},{"ruleId":"54","severity":1,"message":"62","line":12,"column":21,"nodeType":"56","messageId":"57","endLine":12,"endColumn":27},{"ruleId":"63","severity":1,"message":"64","line":24,"column":6,"nodeType":"65","endLine":24,"endColumn":8,"suggestions":"73"},{"ruleId":"63","severity":1,"message":"67","line":36,"column":6,"nodeType":"65","endLine":36,"endColumn":26,"suggestions":"74"},{"ruleId":"54","severity":1,"message":"75","line":3,"column":50,"nodeType":"56","messageId":"57","endLine":3,"endColumn":54},{"ruleId":"63","severity":1,"message":"64","line":14,"column":6,"nodeType":"65","endLine":14,"endColumn":8,"suggestions":"76"},{"ruleId":"54","severity":1,"message":"77","line":16,"column":21,"nodeType":"56","messageId":"57","endLine":16,"endColumn":26},{"ruleId":"63","severity":1,"message":"78","line":23,"column":6,"nodeType":"65","endLine":23,"endColumn":15,"suggestions":"79"},"no-unused-vars","'toast' is defined but never used.","Identifier","unusedVar","no-native-reassign",["80"],"no-negated-in-lhs",["81"],"'errors' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array.","ArrayExpression",["82"],"React Hook useEffect has missing dependencies: 'dispatch', 'errorMessage', and 'history'. Either include them or remove the dependency array.",["83"],"no-empty-pattern","Unexpected empty object pattern.","ObjectPattern","unexpected",["84"],["85"],"'Link' is defined but never used.",["86"],"'email' is assigned a value but never used.","React Hook useEffect has missing dependencies: 'dispatch' and 'history'. Either include them or remove the dependency array.",["87"],"no-global-assign","no-unsafe-negation",{"desc":"88","fix":"89"},{"desc":"90","fix":"91"},{"desc":"88","fix":"92"},{"desc":"93","fix":"94"},{"desc":"88","fix":"95"},{"desc":"96","fix":"97"},"Update the dependencies array to be: [dispatch]",{"range":"98","text":"99"},"Update the dependencies array to be: [isSuccess, isError, dispatch, history, errorMessage]",{"range":"100","text":"101"},{"range":"102","text":"99"},"Update the dependencies array to be: [dispatch, errorMessage, history, isError, isSuccess]",{"range":"103","text":"104"},{"range":"105","text":"99"},"Update the dependencies array to be: [dispatch, history, isError]",{"range":"106","text":"107"},[759,761],"[dispatch]",[973,993],"[isSuccess, isError, dispatch, history, errorMessage]",[756,758],[970,990],"[dispatch, errorMessage, history, isError, isSuccess]",[539,541],[722,731],"[dispatch, history, isError]"]