DoubleTian-tw / pokemon-Gym

https://pokemon-gym.vercel.app/
9 stars 1 forks source link

練習解決 npm run lint 出現的 error #2

Closed QzCurious closed 7 months ago

QzCurious commented 8 months ago

ESLint

ESLint 簡單來說是語法、寫法檢查工具,它可以幫助我們寫出更有規範的程式碼。vite 起的專案預設就有幫我們配置,可以試著去看錯誤訊息並解決

建議處理

  1. react/prop-types 可以暫時不用管,之後學 TypeScript 世界會更好
  2. react/display-name 要去了解一下問題。簡單來說你用 React.memo 包起來的 component 會沒有名字,所以要再另外給他一個名字。這個 displayName 主要是用在 React Devtools
  3. react-hooks/exhaustive-deps useEffect, useMemo, useCallback 很重要的概念,基本上是用以保證你的 react 的狀態有正確更新。一開始可能會沒那麼好理解,我可以再口述解釋
  4. react-hooks/rules-of-hooks 這也沒那麼好懂,我再解釋
  5. no-unsafe-optional-chaining 這是 JavaScript 的問題不是 react,應該不難懂
  6. 優先處理 error,以後再來看 warning

關掉某些 error 或 warning

ESLint 比較偏輔助,也就是就算你不管它的訊息你的程式仍然能跑,所以有些設定可以依你的偏好關掉,像我就不想看到 no-unused-vars 的錯誤。 可以去研究一下 ESLint 怎麼把 react/prop-types, no-unused-vars 這幾項規則關掉。 提示: 可以先不用徹底去了解 ESLint,先在 .eslintrc.cjs 拼拼湊湊讓上述兩項規則不會再被 ESLint 報錯就好。

錯誤訊息

在 Terminal 跑 npm run lint (我是在 cc7176ce9 這個 commit 底下跑的) :

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Footer/Footer.jsx
  4:13  error  'textColor' is assigned a value but never used  no-unused-vars

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/ButtonGroups.jsx
   21:21  error  'children' is missing in props validation           react/prop-types
   35:25  error  'children' is missing in props validation           react/prop-types
   35:35  error  'selectType' is missing in props validation         react/prop-types
   35:47  error  'handleOnClick' is missing in props validation      react/prop-types
   35:62  error  'types' is missing in props validation              react/prop-types
   36:13  error  'types.type' is missing in props validation         react/prop-types
   36:19  error  'types.title' is missing in props validation        react/prop-types
   43:36  error  'selectType.type' is missing in props validation    react/prop-types
   54:24  error  'id' is missing in props validation                 react/prop-types
  128:7   error  'ShowColorText' is assigned a value but never used  no-unused-vars
  131:45  error  'color' is not defined                              no-undef
  131:55  error  'text' is not defined                               no-undef
  136:22  error  'color' is missing in props validation              react/prop-types
  136:29  error  'text' is missing in props validation               react/prop-types
  145:24  error  'id' is missing in props validation                 react/prop-types
  221:21  error  'text' is missing in props validation               react/prop-types
  225:26  error  'text' is missing in props validation               react/prop-types
  291:24  error  Component definition is missing display name        react/display-name
  292:8   error  'filterTitle' is missing in props validation        react/prop-types
  292:21  error  'filterZh' is missing in props validation           react/prop-types
  292:31  error  'handleOnClick' is missing in props validation      react/prop-types
  292:46  error  'data' is missing in props validation               react/prop-types
  319:31  error  'data.map' is missing in props validation           react/prop-types
  342:25  error  'id' is missing in props validation                 react/prop-types

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/CharacterGroups.jsx
   23:27  error  Component definition is missing display name           react/display-name
   23:35  error  'item' is missing in props validation                  react/prop-types
   23:41  error  'showType_select' is missing in props validation       react/prop-types
   23:58  error  'styleObj' is missing in props validation              react/prop-types
   25:15  error  'item.Types' is missing in props validation            react/prop-types
   28:21  error  'item.Types' is missing in props validation            react/prop-types
   56:5   error  'showInfo_select' is missing in props validation       react/prop-types
   57:5   error  'showType_select' is missing in props validation       react/prop-types
   58:5   error  'item' is missing in props validation                  react/prop-types
   59:5   error  'isActive' is missing in props validation              react/prop-types
   60:5   error  'handleClick' is missing in props validation           react/prop-types
  126:27  error  Component definition is missing display name           react/display-name
  127:8   error  'showInfo_select' is missing in props validation       react/prop-types
  127:25  error  'showType_select' is missing in props validation       react/prop-types
  127:42  error  'displayTier' is missing in props validation           react/prop-types
  127:55  error  'bestDamage' is missing in props validation            react/prop-types
  140:45  error  'displayTier[].filter' is missing in props validation  react/prop-types
  143:40  error  'bestDamage.some' is missing in props validation       react/prop-types
  156:41  error  'displayTier[].map' is missing in props validation     react/prop-types
  176:25  error  Component definition is missing display name           react/display-name
  178:9   error  'showInfo_select' is missing in props validation       react/prop-types
  179:9   error  'showType_select' is missing in props validation       react/prop-types
  180:9   error  'displayCharacter' is missing in props validation      react/prop-types
  181:9   error  'handleClick' is missing in props validation           react/prop-types
  182:9   error  'id' is missing in props validation                    react/prop-types

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/CharacterShowInfo.jsx
    2:10  error    'LazyLoadImage' is defined but never used                                                                                       no-unused-vars
    9:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
    9:30  error    Component definition is missing display name                                                                                    react/display-name
    9:38  error    'bgColor' is missing in props validation                                                                                        react/prop-types
    9:47  error    'zhName' is missing in props validation                                                                                         react/prop-types
   23:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
   23:31  error    Component definition is missing display name                                                                                    react/display-name
   23:39  error    'bgColor' is missing in props validation                                                                                        react/prop-types
   37:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
   37:35  error    Component definition is missing display name                                                                                    react/display-name
   37:43  error    'bgColor' is missing in props validation                                                                                        react/prop-types
   37:52  error    'zhName' is missing in props validation                                                                                         react/prop-types
   37:60  error    'enName' is missing in props validation                                                                                         react/prop-types
   54:34  error    Component definition is missing display name                                                                                    react/display-name
   55:8   error    'item' is missing in props validation                                                                                           react/prop-types
   55:14  error    'isActive' is missing in props validation                                                                                       react/prop-types
   55:24  error    'handleClick' is missing in props validation                                                                                    react/prop-types
   55:37  error    'children' is missing in props validation                                                                                       react/prop-types
   61:28  error    'item.zhName' is missing in props validation                                                                                    react/prop-types
   69:35  error    Component definition is missing display name                                                                                    react/display-name
   70:8   error    'item' is missing in props validation                                                                                           react/prop-types
   70:14  error    'isActive' is missing in props validation                                                                                       react/prop-types
   70:24  error    'handleClick' is missing in props validation                                                                                    react/prop-types
   70:37  error    'children' is missing in props validation                                                                                       react/prop-types
   79:36  error    'item.sprite' is missing in props validation                                                                                    react/prop-types
   80:36  error    'item.zhName' is missing in props validation                                                                                    react/prop-types
   81:38  error    'item.zhName' is missing in props validation                                                                                    react/prop-types
  102:5   error    'item' is missing in props validation                                                                                           react/prop-types
  103:5   error    'isActive' is missing in props validation                                                                                       react/prop-types
  104:5   error    'handleClick' is missing in props validation                                                                                    react/prop-types
  105:5   error    'children' is missing in props validation                                                                                       react/prop-types
  113:28  error    'item.zhName' is missing in props validation                                                                                    react/prop-types
  118:28  error    'item.sprite' is missing in props validation                                                                                    react/prop-types
  119:28  error    'item.zhName' is missing in props validation                                                                                    react/prop-types
  120:30  error    'item.zhName' is missing in props validation                                                                                    react/prop-types

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/Dropdowns.jsx
   8:7   warning  Fast refresh only works when a file only exports components. Move your component(s) to a separate file  react-refresh/only-export-components
  30:7   warning  Fast refresh only works when a file only exports components. Move your component(s) to a separate file  react-refresh/only-export-components
  30:22  error    'title' is missing in props validation                                                                  react/prop-types
  30:29  error    'id' is missing in props validation                                                                     react/prop-types
  31:22  error    'textColor' is assigned a value but never used                                                          no-unused-vars
  60:16  warning  Fast refresh can't handle anonymous components. Add a name to your export                               react-refresh/only-export-components

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/Hero.jsx
   3:29  error    'useState' is defined but never used                                                                                      no-unused-vars
  12:17  error    'title' is missing in props validation                                                                                    react/prop-types
  12:24  error    'typeClass' is missing in props validation                                                                                react/prop-types
  12:35  error    'children' is missing in props validation                                                                                 react/prop-types
  12:45  error    'id' is missing in props validation                                                                                       react/prop-types
  29:9   error    'page' is assigned a value but never used                                                                                 no-unused-vars
  58:8   warning  React Hook useEffect has missing dependencies: 'id' and 'scrollDown'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/Heros.jsx
   5:5   error  'useFetchPokemon' is defined but never used             no-unused-vars
  12:5   error  'fetchPopularPokemon' is defined but never used         no-unused-vars
  14:5   error  'filterPopularPokemon' is defined but never used        no-unused-vars
  15:5   error  'filterTierPokemon' is defined but never used           no-unused-vars
  18:37  error  'useMemo' is defined but never used                     no-unused-vars
  18:46  error  'useState' is defined but never used                    no-unused-vars
  38:9   error  'filterBestPokemon' is assigned a value but never used  no-unused-vars
  47:9   error  'process' is not defined                                no-undef

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/TypeView.jsx
  15:25  error  'title' is missing in props validation               react/prop-types
  15:32  error  'detail_item' is missing in props validation         react/prop-types
  15:45  error  'textColor' is missing in props validation           react/prop-types
  20:30  error  'detail_item.length' is missing in props validation  react/prop-types
  23:33  error  'detail_item.map' is missing in props validation     react/prop-types
  42:25  error  'bgColor' is assigned a value but never used         no-unused-vars

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/useDamageHook.js
  41:8  warning  React Hook useEffect has a missing dependency: 'handleBestDamage'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/useFetchFirebase.js
    4:10  error    'useCallback' is defined but never used                                                                                                                                                                                                                           no-unused-vars
   22:64  error    React Hook "useHeroContext" is called in function "fetchTierPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"      react-hooks/rules-of-hooks
   24:5   error    React Hook "useEffect" is called in function "fetchTierPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"           react-hooks/rules-of-hooks
   56:8   warning  React Hook useEffect has missing dependencies: 'handleTierPokemon' and 'storeAllPokemon'. Either include them or remove the dependency array                                                                                                                      react-hooks/exhaustive-deps
   62:9   error    'popularPokemon' is assigned a value but never used                                                                                                                                                                                                               no-unused-vars
   63:9   error    'storeAllPokemon' is assigned a value but never used                                                                                                                                                                                                              no-unused-vars
   65:9   error    'handleFilterBestPokemon' is assigned a value but never used                                                                                                                                                                                                      no-unused-vars
   66:9   error    React Hook "useHeroContext" is called in function "filterTierPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"     react-hooks/rules-of-hooks
   67:5   error    React Hook "useEffect" is called in function "filterTierPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"          react-hooks/rules-of-hooks
   84:8   warning  React Hook useEffect has a missing dependency: 'tierPokemon'. Either include it or remove the dependency array                                                                                                                                                    react-hooks/exhaustive-deps
   91:5   error    Unnecessary try/catch wrapper                                                                                                                                                                                                                                     no-useless-catch
  107:7   error    'checkPokemonData' is assigned a value but never used                                                                                                                                                                                                             no-unused-vars
  112:13  error    'Types' is assigned a value but never used                                                                                                                                                                                                                        no-unused-vars
  112:20  error    'zhName' is assigned a value but never used                                                                                                                                                                                                                       no-unused-vars
  112:36  error    'pokeId' is assigned a value but never used                                                                                                                                                                                                                       no-unused-vars
  112:44  error    'sprite' is assigned a value but never used                                                                                                                                                                                                                       no-unused-vars
  152:5   error    Unnecessary try/catch wrapper                                                                                                                                                                                                                                     no-useless-catch
  201:20  error    'result' is defined but never used                                                                                                                                                                                                                                no-unused-vars
  210:16  error    'result' is defined but never used                                                                                                                                                                                                                                no-unused-vars
  215:38  error    React Hook "useHeroContext" is called in function "fetchPopularPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"   react-hooks/rules-of-hooks
  216:5   error    React Hook "useEffect" is called in function "fetchPopularPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"        react-hooks/rules-of-hooks
  228:8   warning  React Hook useEffect has a missing dependency: 'handlePopularPokemon'. Either include it or remove the dependency array                                                                                                                                           react-hooks/exhaustive-deps
  237:9   error    React Hook "useHeroContext" is called in function "filterPopularPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"  react-hooks/rules-of-hooks
  238:5   error    React Hook "useEffect" is called in function "filterPopularPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"       react-hooks/rules-of-hooks
  266:8   warning  React Hook useEffect has missing dependencies: 'handleFilterBestPokemon', 'popularPokemon', and 'storeAllPokemon'. Either include them or remove the dependency array                                                                                             react-hooks/exhaustive-deps

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/useHeroContext.jsx
    1:47  error    'useCallback' is defined but never used                                                                                         no-unused-vars
   10:32  error    'children' is missing in props validation                                                                                       react/prop-types
   92:21  error    'process' is not defined                                                                                                        no-undef
  277:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/Hero/useQueryPokedex.js
   21:7   error    'queryTypesInfo' is assigned a value but never used                                                                                                                                                                                                               no-unused-vars
   23:27  error    React Hook "useQuery" is called in function "queryTypesInfo" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"              react-hooks/rules-of-hooks
   28:12  error    React Hook "useQueries" is called in function "queryTypesInfo" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"            react-hooks/rules-of-hooks
   70:12  error    React Hook "useQuery" is called in function "queryPokemonInfo" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"            react-hooks/rules-of-hooks
   86:27  error    React Hook "useQuery" is called in function "queryTypesDamageRelation" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"    react-hooks/rules-of-hooks
   90:12  error    React Hook "useQueries" is called in function "queryTypesDamageRelation" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"  react-hooks/rules-of-hooks
  121:13  error    Unsafe usage of optional chaining. If it short-circuits with 'undefined' the evaluation will throw TypeError                                                                                                                                                      no-unsafe-optional-chaining
  129:46  error    'index' is defined but never used                                                                                                                                                                                                                                 no-unused-vars
  188:8   warning  React Hook useEffect has missing dependencies: 'FetchDamageRelations', 'FetchPokemonInfo.data?.data?.data', 'handleStoreAllPokemon', and 'handleStoreAllTypes'. Either include them or remove the dependency array                                                react-hooks/exhaustive-deps
  194:9   error    'isLoadingPokemon' is assigned a value but never used                                                                                                                                                                                                             no-unused-vars
  198:9   error    'searchPokemon' is assigned a value but never used                                                                                                                                                                                                                no-unused-vars
  205:9   error    'isFetching' is assigned a value but never used                                                                                                                                                                                                                   no-unused-vars
  206:9   error    'error' is assigned a value but never used                                                                                                                                                                                                                        no-unused-vars
  338:8   warning  React Hook useEffect has missing dependencies: 'handleIsLoadingPokemon', 'handleStoreAllTypes', 'handleStorePokemon', 'pokemonAllTypes', 'pokemonSpecies', and 'pokemonVarieties'. Either include them or remove the dependency array                             react-hooks/exhaustive-deps

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/components/contexts/useTheme.jsx
  16:33  error    'children' is missing in props validation                                                                                       react/prop-types
  44:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/main.jsx
  16:8  error  'Pokedex' is defined but never used  no-unused-vars
  17:8  error  'Login' is defined but never used    no-unused-vars

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/routes/About.jsx
  5:13  error  'textColor' is assigned a value but never used  no-unused-vars

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/routes/ComingSoon.jsx
  5:13  error  'textColor' is assigned a value but never used  no-unused-vars

/home/qz/git-repo/DoubleTian-tw/pokemon-Gym/src/routes/ErrorPage.jsx
  1:10  error  'useRouteError' is defined but never used  no-unused-vars

✖ 163 problems (147 errors, 16 warnings)
DoubleTian-tw commented 8 months ago

已處理好eslint忽略react/prop-types及no-unused-vars rules

.eslint.cjs中加入新規則

rules: {
        "react/prop-types": "off",
        "no-unused-vars": "off",
    },

npm run lint後結果

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\ButtonGroups.jsx
  131:45  error  'color' is not defined  no-undef
  131:55  error  'text' is not defined   no-undef

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\CharacterGroups.jsx
   23:27  error  Component definition is missing display name  react/display-name
  126:27  error  Component definition is missing display name  react/display-name
  176:25  error  Component definition is missing display name  react/display-name

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\CharacterShowInfo.jsx
   9:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
   9:30  error    Component definition is missing display name
              react/display-name
  23:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  23:31  error    Component definition is missing display name
              react/display-name
  37:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components
  37:35  error    Component definition is missing display name
              react/display-name
  54:34  error    Component definition is missing display name
              react/display-name
  69:35  error    Component definition is missing display name
              react/display-name

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\Dropdowns.jsx
   8:7   warning  Fast refresh only works when a file only exports components. Move your component(s) to a separate file  react-refresh/only-export-components
  30:7   warning  Fast refresh only works when a file only exports components. Move your component(s) to a separate file  react-refresh/only-export-components
  60:16  warning  Fast refresh can't handle anonymous components. Add a name to your export                               react-refresh/only-export-components

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\Hero.jsx
  58:8  warning  React Hook useEffect has missing dependencies: 'id' and 'scrollDown'. Either include them or remove the dependency 
array  react-hooks/exhaustive-deps

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\Heros.jsx
  48:9  error  'process' is not defined  no-undef

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\useDamageHook.js
  41:8  warning  React Hook useEffect has a missing dependency: 'handleBestDamage'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\useFetchFirebase.js
   22:64  error    React Hook "useHeroContext" is called in function "fetchTierPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"      react-hooks/rules-of-hooks
   24:5   error    React Hook "useEffect" is called in function "fetchTierPokemon" that is neither a React function component nor a 
custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"           react-hooks/rules-of-hooks
   56:8   warning  React Hook useEffect has missing dependencies: 'handleTierPokemon' and 'storeAllPokemon'. Either include them or 
remove the dependency array
             react-hooks/exhaustive-deps
   66:9   error    React Hook "useHeroContext" is called in function "filterTierPokemon" that is neither a React function component 
nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"     react-hooks/rules-of-hooks
   67:5   error    React Hook "useEffect" is called in function "filterTierPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"          react-hooks/rules-of-hooks
   84:8   warning  React Hook useEffect has a missing dependency: 'tierPokemon'. Either include it or remove the dependency array   

             react-hooks/exhaustive-deps
   91:5   error    Unnecessary try/catch wrapper

             no-useless-catch
  152:5   error    Unnecessary try/catch wrapper

             no-useless-catch
  215:38  error    React Hook "useHeroContext" is called in function "fetchPopularPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the 
word "use"   react-hooks/rules-of-hooks
  216:5   error    React Hook "useEffect" is called in function "fetchPopularPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word 
"use"        react-hooks/rules-of-hooks
  228:8   warning  React Hook useEffect has a missing dependency: 'handlePopularPokemon'. Either include it or remove the dependency array
             react-hooks/exhaustive-deps
  237:9   error    React Hook "useHeroContext" is called in function "filterPopularPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"  react-hooks/rules-of-hooks
  238:5   error    React Hook "useEffect" is called in function "filterPopularPokemon" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"       react-hooks/rules-of-hooks
  266:8   warning  React Hook useEffect has missing dependencies: 'handleFilterBestPokemon', 'popularPokemon', and 'storeAllPokemon'. Either include them or remove the dependency array
             react-hooks/exhaustive-deps

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\useHeroContext.jsx
   92:21  error    'process' is not defined
               no-undef
  292:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components  react-refresh/only-export-components

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\Hero\useQueryPokedex.js
   23:27  error    React Hook "useQuery" is called in function "queryTypesInfo" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use" 
             react-hooks/rules-of-hooks
   28:12  error    React Hook "useQueries" is called in function "queryTypesInfo" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"            react-hooks/rules-of-hooks
   70:12  error    React Hook "useQuery" is called in function "queryPokemonInfo" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "usese"            react-hooks/rules-of-hooks
   86:27  error    React Hook "useQuery" is called in function "queryTypesDamageRelation" that is neither a React function componentnt nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with t whe word "use"    react-hooks/rules-of-hooks
   90:12  error    React Hook "useQueries" is called in function "queryTypesDamageRelation" that is neither a React function componenent nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start withhe the word "use"  react-hooks/rules-of-hooks
  121:13  error    Unsafe usage of optional chaining. If it short-circuits with 'undefined' the evaluation will throw TypeError     

                 no-unsafe-optional-chaining
  188:8   warning  React Hook useEffect has missing dependencies: 'FetchDamageRelations', 'FetchPokemonInfo.data?.data?.data', 'handndleStoreAllPokemon', and 'handleStoreAllTypes'. Either include them or remove the dependency array
                 react-hooks/exhaustive-deps
  338:8   warning  React Hook useEffect has missing dependencies: 'handleIsLoadingPokemon', 'handleStoreAllTypes', 'handleStorePokememon', 'pokemonAllTypes', 'pokemonSpecies', and 'pokemonVarieties'. Either include them or remove the dependency array
                 react-hooks/exhaustive-deps

D:\vs_code\Github-pages\pokemon-go-gym-vite\src\components\contexts\useTheme.jsx
  44:14  warning  Fast refresh only works when a file only exports components. Use a new file to share constants or functions betweeeen components  react-refresh/only-export-components

✖ 44 problems (28 errors, 16 warnings)
DoubleTian-tw commented 8 months ago

上傳new branch development並修正剩下errors