-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 29.8 KB
/
.eslintcache
1
[{"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\index.tsx":"1","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\reportWebVitals.ts":"2","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\App.tsx":"3","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\list.tsx":"4","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\search-panel.tsx":"5","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\index.tsx":"6","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\context\\index.tsx":"7","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\context\\auth-context.tsx":"8","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\authenticated-app.tsx":"9","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\auth-provider.ts":"10","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\unauthenticated-app\\index.tsx":"11","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\unauthenticated-app\\login.tsx":"12","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\unauthenticated-app\\register.tsx":"13","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\index.ts":"14","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\http.ts":"15","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\lib.tsx":"16","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\user.ts":"17","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\project.ts":"18","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\use-async.ts":"19","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project\\index.tsx":"20","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\index.tsx":"21","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\epic\\index.tsx":"22","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\url.ts":"23","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\util.ts":"24","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\pin.tsx":"25","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\project-popover.tsx":"26","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\project-modal.tsx":"27","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\user-select.tsx":"28","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\id-select.tsx":"29","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\use-optimistic-opinion.ts":"30","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\util.ts":"31","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\kanban.ts":"32","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\kanban-column.tsx":"33","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\task.ts":"34","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\task-type.ts":"35","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\search-panel.tsx":"36","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\task-type-select.tsx":"37","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\create-kanban.tsx":"38","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\task-modal.tsx":"39","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\create-task.tsx":"40","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\mark.tsx":"41","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\drag-and-drop.tsx":"42","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\reorder.ts":"43","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\epic.ts":"44","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\epic\\util.ts":"45","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\epic\\create-epic.tsx":"46","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\user-popover.tsx":"47","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\error-boundary.tsx":"48"},{"size":764,"mtime":1614519097744,"results":"49","hashOfConfig":"50"},{"size":425,"mtime":499162500000,"results":"51","hashOfConfig":"50"},{"size":627,"mtime":1618504201605,"results":"52","hashOfConfig":"50"},{"size":3568,"mtime":1616951835077,"results":"53","hashOfConfig":"50"},{"size":1135,"mtime":1616951835108,"results":"54","hashOfConfig":"50"},{"size":1482,"mtime":1618411423483,"results":"55","hashOfConfig":"50"},{"size":494,"mtime":1619103095426,"results":"56","hashOfConfig":"50"},{"size":1947,"mtime":1618504835541,"results":"57","hashOfConfig":"50"},{"size":3024,"mtime":1619103370672,"results":"58","hashOfConfig":"50"},{"size":1492,"mtime":1616951835098,"results":"59","hashOfConfig":"50"},{"size":2288,"mtime":1618411165961,"results":"60","hashOfConfig":"50"},{"size":1212,"mtime":1618411165945,"results":"61","hashOfConfig":"50"},{"size":1582,"mtime":1618411165945,"results":"62","hashOfConfig":"50"},{"size":2623,"mtime":1619101907810,"results":"63","hashOfConfig":"50"},{"size":1706,"mtime":1614844136181,"results":"64","hashOfConfig":"50"},{"size":1632,"mtime":1617567884910,"results":"65","hashOfConfig":"50"},{"size":310,"mtime":1618399104546,"results":"66","hashOfConfig":"50"},{"size":1484,"mtime":1616951507863,"results":"67","hashOfConfig":"50"},{"size":2588,"mtime":1615953838493,"results":"68","hashOfConfig":"50"},{"size":1715,"mtime":1617638457477,"results":"69","hashOfConfig":"50"},{"size":4793,"mtime":1618260159926,"results":"70","hashOfConfig":"50"},{"size":3416,"mtime":1618309472720,"results":"71","hashOfConfig":"50"},{"size":1335,"mtime":1616575980738,"results":"72","hashOfConfig":"50"},{"size":1460,"mtime":1618411450455,"results":"73","hashOfConfig":"50"},{"size":431,"mtime":1614412002554,"results":"74","hashOfConfig":"50"},{"size":1243,"mtime":1618411279937,"results":"75","hashOfConfig":"50"},{"size":3605,"mtime":1618503813734,"results":"76","hashOfConfig":"50"},{"size":301,"mtime":1614245894148,"results":"77","hashOfConfig":"50"},{"size":1381,"mtime":1615855242766,"results":"78","hashOfConfig":"50"},{"size":1875,"mtime":1618300861108,"results":"79","hashOfConfig":"50"},{"size":1879,"mtime":1618411382343,"results":"80","hashOfConfig":"50"},{"size":1582,"mtime":1618300923313,"results":"81","hashOfConfig":"50"},{"size":4069,"mtime":1618300518018,"results":"82","hashOfConfig":"50"},{"size":1958,"mtime":1618300910598,"results":"83","hashOfConfig":"50"},{"size":280,"mtime":1617378594099,"results":"84","hashOfConfig":"50"},{"size":1295,"mtime":1617456806485,"results":"85","hashOfConfig":"50"},{"size":324,"mtime":1617456373321,"results":"86","hashOfConfig":"50"},{"size":742,"mtime":1617695382623,"results":"87","hashOfConfig":"50"},{"size":2629,"mtime":1618503725157,"results":"88","hashOfConfig":"50"},{"size":1234,"mtime":1617639452186,"results":"89","hashOfConfig":"50"},{"size":541,"mtime":1617784152232,"results":"90","hashOfConfig":"50"},{"size":1820,"mtime":1618297884701,"results":"91","hashOfConfig":"50"},{"size":1748,"mtime":1618300817032,"results":"92","hashOfConfig":"50"},{"size":1004,"mtime":1618309662063,"results":"93","hashOfConfig":"50"},{"size":213,"mtime":1618309420013,"results":"94","hashOfConfig":"50"},{"size":2713,"mtime":1618503761648,"results":"95","hashOfConfig":"50"},{"size":981,"mtime":1618399063463,"results":"96","hashOfConfig":"50"},{"size":723,"mtime":1613142148033,"results":"97","hashOfConfig":"50"},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},"k461r0",{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"105","messages":"106","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"109","messages":"110","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"113","messages":"114","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"115","usedDeprecatedRules":"100"},{"filePath":"116","messages":"117","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"118","messages":"119","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"120","messages":"121","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"122","messages":"123","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"124","messages":"125","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"126","messages":"127","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"128","messages":"129","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"130","messages":"131","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"132","messages":"133","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"134","messages":"135","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"136","usedDeprecatedRules":"100"},{"filePath":"137","messages":"138","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"139","usedDeprecatedRules":"100"},{"filePath":"140","messages":"141","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"142","messages":"143","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"144","messages":"145","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"146","messages":"147","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"148","messages":"149","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"150","messages":"151","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"152","messages":"153","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"154","messages":"155","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"156","messages":"157","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"158","messages":"159","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"160","messages":"161","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"162","messages":"163","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"164","usedDeprecatedRules":"100"},{"filePath":"165","messages":"166","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"167","messages":"168","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"169","messages":"170","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"171","usedDeprecatedRules":"100"},{"filePath":"172","messages":"173","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"174","messages":"175","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"176","messages":"177","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"178","messages":"179","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"180","messages":"181","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"182","messages":"183","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"184"},{"filePath":"185","messages":"186","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"187","messages":"188","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"189","messages":"190","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"191","messages":"192","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"193","messages":"194","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"195","messages":"196","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"197","messages":"198","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"199","messages":"200","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\index.tsx",[],["201","202"],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\reportWebVitals.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\App.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\list.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\search-panel.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\index.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\context\\index.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\context\\auth-context.tsx",["203"],"import React, { ReactNode } from \"react\";\r\nimport * as auth from \"../auth-provider\";\r\nimport {useMount} from \"../utils\";\r\nimport {http} from \"utils/http\";\r\nimport {useAsync} from \"../utils/use-async\";\r\nimport {FullPageErrorFallback} from \"../components/lib\";\r\nimport {useQueryClient} from \"react-query\";\r\nimport {User} from \"../types/user\";\r\n\r\ninterface AuthForm {\r\n username: string;\r\n password: string;\r\n}\r\n\r\nconst AuthContext = React.createContext<\r\n | {\r\n user: User | null;\r\n register: (form: AuthForm) => Promise<void>;\r\n login: (form: AuthForm) => Promise<void>;\r\n logout: () => Promise<void>;\r\n}\r\n | undefined\r\n >(undefined);\r\nAuthContext.displayName = \"AuthContext\";\r\n\r\nconst bootstrapUser = async () => {\r\n let user = null\r\n const token = auth.getToken()\r\n if (token) {\r\n const data = await http('me', {token})\r\n user = data.user\r\n }\r\n return user\r\n}\r\n\r\nexport const AuthProvider = ({ children }: { children: ReactNode }) => {\r\n const {data: user, error, isLoading, isIdle, isError, run, setData: setUser} = useAsync<User | null>();\r\n const queryClient = useQueryClient()\r\n // point free\r\n const login = (form: AuthForm) => auth.login(form).then(setUser);\r\n const register = (form: AuthForm) => auth.register(form).then(setUser);\r\n const logout = () => auth.logout().then(() => {\r\n setUser(null)\r\n queryClient.clear()\r\n });\r\n useMount(() => {\r\n run(bootstrapUser())\r\n })\r\n if (isIdle || isLoading) {\r\n return <p>loading...</p>\r\n }\r\n if (error) {\r\n return <FullPageErrorFallback error={error}/>\r\n }\r\n\r\n return <AuthContext.Provider children={children} value={{ user, login, register, logout }}/>\r\n}\r\n\r\nexport const useAuth = () => {\r\n const context = React.useContext(AuthContext);\r\n if (!context) {\r\n throw new Error(\"useAuth必须在AuthProvider中使用\");\r\n }\r\n return context;\r\n};","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\authenticated-app.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\auth-provider.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\unauthenticated-app\\index.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\unauthenticated-app\\login.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\unauthenticated-app\\register.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\index.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\http.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\lib.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\user.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\project.ts",["204"],"import { useHttp } from \"utils/http\";\r\nimport {QueryKey, useMutation, useQuery, useQueryClient} from \"react-query\";\r\nimport {useAddConfig, useDeleteConfig, useEditConfig} from \"./use-optimistic-opinion\";\r\nimport {Project} from \"../types/project\";\r\n\r\nexport const useProjects = (param?: Partial<Project>) => {\r\n const client = useHttp();\r\n return useQuery<Project[]>(['projects', param], () => client('projects', {data: param}))\r\n};\r\n\r\nexport const useEditProject = (queryKey: QueryKey) => {\r\n const client = useHttp()\r\n return useMutation((params: Partial<Project>) => client(`projects/${params.id}`, {\r\n method: 'PATCH', data:params,\r\n }),\r\n useEditConfig(queryKey)\r\n )\r\n}\r\n\r\nexport const useAddProject = (queryKey: QueryKey) => {\r\n const client = useHttp()\r\n return useMutation((params: Partial<Project>) => client(`projects`, {\r\n data:params,\r\n method: 'POST',\r\n }),\r\n useAddConfig(queryKey)\r\n )\r\n}\r\n\r\nexport const useDeleteProject = (queryKey: QueryKey) => {\r\n const client = useHttp()\r\n return useMutation(({id} : {id: number}) => client(`projects${id}`, {\r\n method: 'DELETE',\r\n }),\r\n useDeleteConfig(queryKey)\r\n )\r\n}\r\n\r\nexport const useProject = (id?: number) => {\r\n const client = useHttp();\r\n return useQuery<Project>(\r\n [\"project\", { id }],\r\n () => client(`projects/${id}`),\r\n {\r\n enabled: Boolean(id),\r\n }\r\n );\r\n};","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\use-async.ts",["205"],"import {useCallback, useReducer, useState} from \"react\";\r\nimport {useMountedRef} from \"./index\";\r\n\r\n\r\ninterface State<D> {\r\n error: Error | null;\r\n data: D | null;\r\n stat: 'idle' | 'loading' | 'error' | 'success'\r\n}\r\n\r\nconst defaultInitialState: State<null> = {\r\n stat:'idle',\r\n data: null,\r\n error: null\r\n}\r\n\r\nconst defaultConfig = {\r\n throwOnError:false\r\n}\r\n\r\nconst useSafeDispatch = <T>(dispatch: (...args: T[]) => void) => {\r\n const mountedRef = useMountedRef()\r\n return useCallback((...args: T[]) => (mountedRef.current ? dispatch(...args) : void 0), [dispatch, mountedRef])\r\n}\r\nexport const useAsync = <D>(initialState?: State<D>, initialConfig?: typeof defaultConfig) => {\r\n const config = {...defaultConfig, initialConfig}\r\n const [state, dispatch] = useReducer((state:State<D>, action:Partial<State<D>>) => ({...state, ...action}),{\r\n ...defaultInitialState,\r\n ...initialState\r\n })\r\n const safeDispatch = useSafeDispatch(dispatch)\r\n const [retry, setRetry] = useState(() => () => {\r\n\r\n })\r\n\r\n const setData = useCallback((data: D) => safeDispatch({\r\n data,\r\n stat: 'success',\r\n error: null\r\n }), [safeDispatch])\r\n\r\n const setError = useCallback((error:Error) => safeDispatch({\r\n error,\r\n stat: 'error',\r\n data: null\r\n }), [safeDispatch])\r\n //run 用来触发异步请求\r\n const run = useCallback((\r\n (promise: Promise<D>, runConfig?: {retry: () => Promise<D>}) => {\r\n if (!promise || !promise.then) {\r\n throw new Error('请传入Promise类型数据')\r\n }\r\n setRetry(() => () => {\r\n if (runConfig?.retry) {\r\n run(runConfig?.retry(), runConfig)\r\n }\r\n })\r\n safeDispatch({stat:'loading'})\r\n return promise.then(data => {\r\n setData(data)\r\n return data\r\n }).catch(error => {\r\n // catch会消化异常,如果不抛出,外面收不到\r\n setError(error)\r\n if (config.throwOnError) Promise.reject(error);\r\n return error;\r\n })\r\n }\r\n ), [config.throwOnError, setData, setError])\r\n\r\n return {\r\n isIdle:state.stat === 'idle',\r\n isLoading: state.stat === 'loading',\r\n isError:state.stat === 'error',\r\n isSuccess: state.stat === 'success',\r\n run,\r\n setData,\r\n setError,\r\n //retry调用后再跑一边run\r\n retry,\r\n ...state\r\n }\r\n}","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project\\index.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\index.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\epic\\index.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\url.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\util.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\pin.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\project-popover.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\project-list\\project-modal.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\user-select.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\id-select.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\use-optimistic-opinion.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\util.ts",["206","207"],"import {useLocation} from \"react-router\";\r\nimport {useCallback, useMemo} from \"react\"\r\nimport {useProject} from \"../../utils/project\";\r\nimport {useUrlQueryParam} from \"../../utils/url\";\r\nimport {useTask} from \"../../utils/task\";\r\nimport {useDebounce} from \"../../utils\";\r\n\r\nexport const useProjectIdInUrl = () => {\r\n const {pathname} = useLocation()\r\n const id = pathname.match(/projects\\/(d+)/)?.[1]\r\n return Number(id)\r\n}\r\n\r\nexport const useProjectInUrl = () => useProject(useProjectIdInUrl())\r\n\r\nexport const useKanbanSearchParams = () => ({\r\n projectId: useProjectIdInUrl()\r\n})\r\n\r\nexport const useKanbansQueryKey = () => ['kanbans', useKanbanSearchParams()]\r\n\r\nexport const useTasksSearchParams = () => {\r\n const [param, setParam] = useUrlQueryParam([\r\n 'name',\r\n 'typeId',\r\n 'processorId',\r\n 'tagId'\r\n ])\r\n const projectId = useProjectIdInUrl()\r\n const debounceName = useDebounce(param.name, 200)\r\n return useMemo(() => ({\r\n projectId,\r\n typeId: Number(param.typeId) || undefined,\r\n processorId: Number(param.processorId) || undefined,\r\n tagId: Number(param.tagId) || undefined,\r\n name: debounceName,\r\n }), [projectId, debounceName])\r\n}\r\n\r\nexport const useTasksQueryKey = () =>['tasks', useTasksSearchParams()]\r\n\r\nexport const useTasksModal = () => {\r\n const [{editingTaskId}, setEditingTaskId] = useUrlQueryParam(['editingTaskId'])\r\n const {data: editingTask, isLoading} = useTask(Number(editingTaskId))\r\n const startEdit = useCallback((id: number) => {\r\n setEditingTaskId({editingTaskId: id})\r\n }, [setEditingTaskId])\r\n const close = useCallback(() => {\r\n setEditingTaskId({editingTaskId: ''})\r\n }, [setEditingTaskId])\r\n return {\r\n editingTaskId,\r\n editingTask,\r\n startEdit,\r\n close,\r\n isLoading\r\n }\r\n}\r\n\r\n","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\kanban.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\kanban-column.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\task.ts",["208"],"import {useHttp} from \"./http\";\r\nimport {QueryKey, useMutation, useQuery} from \"react-query\";\r\nimport {Task} from \"../types/task\";\r\nimport {\r\n useAddConfig,\r\n useDeleteConfig,\r\n useEditConfig,\r\n useReorderTaskConfig\r\n} from \"./use-optimistic-opinion\";\r\nimport {Project} from \"../types/project\";\r\nimport {SortProps} from \"./kanban\";\r\n\r\nexport const useTasks = (param?: Partial<Task>) => {\r\n const client = useHttp();\r\n return useQuery<Task[]>(['tasks', param], () => client('tasks', {data: param}))\r\n};\r\n\r\nexport const useAddTask = (queryKey: QueryKey) => {\r\n const client = useHttp();\r\n\r\n return useMutation(\r\n (params: Partial<Task>) =>\r\n client(`tasks`, {\r\n data: params,\r\n method: \"POST\",\r\n }),\r\n useAddConfig(queryKey)\r\n );\r\n};\r\n\r\nexport const useTask = (id?: number) => {\r\n const client = useHttp()\r\n return useQuery<Project>(\r\n [\"project\", {id}],\r\n () => client(`projects/${id}`),\r\n {\r\n enabled: Boolean(id),\r\n }\r\n )\r\n}\r\n\r\nexport const useEditTask = (queryKey: QueryKey) => {\r\n const client = useHttp();\r\n return useMutation(\r\n (params: Partial<Task>) =>\r\n client(`tasks/${params.id}`, {\r\n method: \"PATCH\",\r\n data: params,\r\n }),\r\n useEditConfig(queryKey)\r\n );\r\n};\r\n\r\nexport const useDeleteTask = (queryKey: QueryKey) => {\r\n const client = useHttp();\r\n\r\n return useMutation(\r\n ({ id }: { id: number }) =>\r\n client(`tasks/${id}`, {\r\n method: \"DELETE\",\r\n }),\r\n useDeleteConfig(queryKey)\r\n );\r\n};\r\n\r\nexport const useReorderTask = (queryKey: QueryKey) => {\r\n const client = useHttp();\r\n return useMutation((params: SortProps) => {\r\n return client(\"tasks/reorder\", {\r\n data: params,\r\n method: \"POST\",\r\n });\r\n }, useReorderTaskConfig(queryKey));\r\n};","C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\task-type.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\search-panel.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\task-type-select.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\create-kanban.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\task-modal.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\kanban\\create-task.tsx",[],["209","210"],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\mark.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\drag-and-drop.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\reorder.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\utils\\epic.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\epic\\util.ts",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\screens\\epic\\create-epic.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\user-popover.tsx",[],"C:\\Users\\Larkl\\WebstormProjects\\jira\\src\\components\\error-boundary.tsx",[],{"ruleId":"211","replacedBy":"212"},{"ruleId":"213","replacedBy":"214"},{"ruleId":"215","severity":1,"message":"216","line":37,"column":50,"nodeType":"217","messageId":"218","endLine":37,"endColumn":57},{"ruleId":"215","severity":1,"message":"219","line":2,"column":42,"nodeType":"217","messageId":"218","endLine":2,"endColumn":56},{"ruleId":"220","severity":1,"message":"221","line":69,"column":8,"nodeType":"222","endLine":69,"endColumn":48,"suggestions":"223"},{"ruleId":"215","severity":1,"message":"224","line":23,"column":19,"nodeType":"217","messageId":"218","endLine":23,"endColumn":27},{"ruleId":"220","severity":1,"message":"225","line":37,"column":9,"nodeType":"222","endLine":37,"endColumn":34,"suggestions":"226"},{"ruleId":"215","severity":1,"message":"227","line":8,"column":5,"nodeType":"217","messageId":"218","endLine":8,"endColumn":21},{"ruleId":"211","replacedBy":"228"},{"ruleId":"213","replacedBy":"229"},"no-native-reassign",["230"],"no-negated-in-lhs",["231"],"@typescript-eslint/no-unused-vars","'isError' is assigned a value but never used.","Identifier","unusedVar","'useQueryClient' is defined but never used.","react-hooks/exhaustive-deps","React Hook useCallback has a missing dependency: 'safeDispatch'. Either include it or remove the dependency array.","ArrayExpression",["232"],"'setParam' is assigned a value but never used.","React Hook useMemo has missing dependencies: 'param.processorId', 'param.tagId', and 'param.typeId'. Either include them or remove the dependency array.",["233"],"'useReorderConfig' is defined but never used.",["230"],["231"],"no-global-assign","no-unsafe-negation",{"desc":"234","fix":"235"},{"desc":"236","fix":"237"},"Update the dependencies array to be: [config.throwOnError, safeDispatch, setData, setError]",{"range":"238","text":"239"},"Update the dependencies array to be: [projectId, param.typeId, param.processorId, param.tagId, debounceName]",{"range":"240","text":"241"},[2156,2196],"[config.throwOnError, safeDispatch, setData, setError]",[1205,1230],"[projectId, param.typeId, param.processorId, param.tagId, debounceName]"]