Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIEM] Restore rules of hooks #67878

Closed
wants to merge 3 commits into from

Conversation

oatkiller
Copy link
Contributor

@oatkiller oatkiller commented Jun 1, 2020

Summary

I would like to propose that we restore the 'rules of hooks' eslint rule. You can read about rules of hooks here: https://reactjs.org/docs/hooks-rules.html We have disabled this eslint rule.

Enabling the rule will help us catch errors. It also makes complying with the rules very easy (via eslint autofix.) Here is a gif showing how eslint will automatically calculate a hooks dependencies.

rules_of_hooks mov

I have a branch where I restored the rule. Here is the result of running yarn lint:es:

✖ 265 problems (265 errors, 0 warnings)
  258 errors and 0 warnings potentially fixable with the `--fix` option.
raustin-mbp:kibana raustin$ yarn lint:es
yarn run v1.22.0
$ node scripts/eslint

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/add_item_form/index.tsx
  129:6  error  React Hook useEffect has an unnecessary dependency: 'inputsRef.current'. Either exclude it or remove the dependency array. Mutable values like 'inputsRef.current' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/mitre/index.tsx
  104:5  error  React Hook useCallback has a missing dependency: 'values'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/pick_timeline/index.tsx
  42:6  error  React Hook useEffect has missing dependencies: 'timelineId' and 'timelineTitle'. Either include them or remove the dependency array    react-hooks/exhaustive-deps
  52:5  error  React Hook useCallback has missing dependencies: 'timelineId' and 'timelineTitle'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/query_bar/index.tsx
  114:6  error  React Hook useEffect has missing dependencies: 'field' and 'filterManager'. Either include them or remove the dependency array                                            react-hooks/exhaustive-deps
  146:6  error  React Hook useEffect has missing dependencies: 'filterManager', 'queryDraft', 'savedQuery', and 'savedQueryServices'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  182:5  error  React Hook useCallback has a missing dependency: 'field'. Either include it or remove the dependency array                                                                react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_field/index.tsx
  59:5  error  React Hook useCallback has a missing dependency: 'field'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  74:5  error  React Hook useCallback has a missing dependency: 'field'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  85:6  error  React Hook useEffect has a missing dependency: 'http'. Either include it or remove the dependency array     react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/rule_actions_overflow/index.tsx
  104:5  error  React Hook useMemo has missing dependencies: 'dispatchToaster' and 'onRuleDeletedCallback'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/rule_switch/index.tsx
   97:5  error  React Hook useCallback has missing dependencies: 'dispatchToaster' and 'onChange'. Either include them or remove the dependency array. If 'onChange' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  104:6  error  React Hook useEffect has a missing dependency: 'myEnabled'. Either include it or remove the dependency array                                                                                                                                               react-hooks/exhaustive-deps
  110:6  error  React Hook useEffect has a missing dependency: 'myIsLoading'. Either include it or remove the dependency array                                                                                                                                             react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/schedule_item_form/index.tsx
   81:5  error  React Hook useCallback has a missing dependency: 'field'. Either include it or remove the dependency array                   react-hooks/exhaustive-deps
   90:5  error  React Hook useCallback has a missing dependency: 'field'. Either include it or remove the dependency array                   react-hooks/exhaustive-deps
  114:6  error  React Hook useEffect has missing dependencies: 'timeType' and 'timeVal'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/index.tsx
  104:6  error  React Hook useCallback has a missing dependency: 'setStepData'. Either include it or remove the dependency array. If 'setStepData' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  116:6  error  React Hook useEffect has missing dependencies: 'form' and 'myStepData'. Either include them or remove the dependency array                                                                                                               react-hooks/exhaustive-deps
  122:6  error  React Hook useEffect has a missing dependency: 'setForm'. Either include it or remove the dependency array. If 'setForm' changes too often, find the parent component that defines it and wrap that definition in useCallback            react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/step_define_rule/index.tsx
  126:6  error  React Hook useCallback has a missing dependency: 'setStepData'. Either include it or remove the dependency array. If 'setStepData' changes too often, find the parent component that defines it and wrap that definition in useCallback              react-hooks/exhaustive-deps
  135:6  error  React Hook useEffect has missing dependencies: 'form' and 'myStepData'. Either include them or remove the dependency array. Outer scope values like 'setFieldValue' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps
  141:6  error  React Hook useEffect has a missing dependency: 'setForm'. Either include it or remove the dependency array. If 'setForm' changes too often, find the parent component that defines it and wrap that definition in useCallback                        react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/step_rule_actions/index.tsx
  102:5  error  React Hook useCallback has a missing dependency: 'setStepData'. Either include it or remove the dependency array. If 'setStepData' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  115:6  error  React Hook useEffect has missing dependencies: 'form', 'myStepData', and 'schema'. Either include them or remove the dependency array                                                                                                    react-hooks/exhaustive-deps
  121:6  error  React Hook useEffect has a missing dependency: 'setForm'. Either include it or remove the dependency array. If 'setForm' changes too often, find the parent component that defines it and wrap that definition in useCallback            react-hooks/exhaustive-deps
  145:5  error  React Hook useMemo has a missing dependency: 'throttleOptions'. Either include it or remove the dependency array                                                                                                                         react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/step_schedule_rule/index.tsx
  65:6  error  React Hook useCallback has a missing dependency: 'setStepData'. Either include it or remove the dependency array. If 'setStepData' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  77:6  error  React Hook useEffect has missing dependencies: 'form' and 'myStepData'. Either include them or remove the dependency array                                                                                                               react-hooks/exhaustive-deps
  83:6  error  React Hook useEffect has a missing dependency: 'setForm'. Either include it or remove the dependency array. If 'setForm' changes too often, find the parent component that defines it and wrap that definition in useCallback            react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/rules/throttle_select_field/index.tsx
  34:5  error  React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the useCallback call and refer to those specific props inside useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/signals/index.tsx
  113:6  error  React Hook useCallback has a missing dependency: 'defaultFilters'. Either include it or remove the dependency array                                                                                                                                                     react-hooks/exhaustive-deps
  139:5  error  React Hook useCallback has an unnecessary dependency: 'SIGNALS_PAGE_TIMELINE_ID'. Either exclude it or remove the dependency array. Outer scope values like 'SIGNALS_PAGE_TIMELINE_ID' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps
  146:5  error  React Hook useCallback has an unnecessary dependency: 'SIGNALS_PAGE_TIMELINE_ID'. Either exclude it or remove the dependency array. Outer scope values like 'SIGNALS_PAGE_TIMELINE_ID' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/signals_histogram_panel/index.tsx
  134:7  error  React Hook useMemo has a missing dependency: 'defaultNumberFormat'. Either include it or remove the dependency array                                                                                                                                                                                                         react-hooks/exhaustive-deps
  141:8  error  React Hook useCallback has missing dependencies: 'defaultStackByOption' and 'stackByOptions'. Either include them or remove the dependency array. If 'setSelectedStackByOption' needs the current value of 'stackByOptions', you can also switch to useReducer instead of useState and read 'stackByOptions' in the reducer  react-hooks/exhaustive-deps
  178:8  error  React Hook useEffect has missing dependencies: 'deleteQuery' and 'uniqueQueryId'. Either include them or remove the dependency array. If 'deleteQuery' changes too often, find the parent component that defines it and wrap that definition in useCallback                                                                  react-hooks/exhaustive-deps
  192:8  error  React Hook useEffect has a missing dependency: 'uniqueQueryId'. Either include it or remove the dependency array                                                                                                                                                                                                             react-hooks/exhaustive-deps
  222:8  error  React Hook useEffect has missing dependencies: 'kibana.services.uiSettings' and 'setSignalsQuery'. Either include them or remove the dependency array                                                                                                                                                                        react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/components/user_info/index.tsx
  172:6  error  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  178:6  error  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  184:6  error  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  194:6  error  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  200:6  error  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  206:6  error  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  212:6  error  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  218:6  error  React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/fetch_index_patterns.tsx
  97:6  error  React Hook useEffect has missing dependencies: 'apolloClient' and 'dispatchToaster'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/persist_rule.tsx
  56:6  error  React Hook useEffect has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_pre_packaged_rules.tsx
  188:6  error  React Hook useEffect has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule.tsx
  58:6  error  React Hook useEffect has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rule_status.tsx
   67:6  error  React Hook useEffect has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  122:6  error  React Hook useEffect has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_rules.tsx
  92:6  error  React Hook useEffect has missing dependencies: 'dispatchRulesInReducer', 'dispatchToaster', 'filterOptions', and 'pagination'. Either include them or remove the dependency array. If 'dispatchRulesInReducer' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  98:5  error  React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked                                                                                                                                                                             react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/containers/detection_engine/rules/use_tags.tsx
  56:6  error  React Hook useEffect has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/containers/detection_engine/signals/use_privilege_user.tsx
  86:6  error  React Hook useEffect has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/containers/detection_engine/signals/use_signal_index.tsx
  106:6  error  React Hook useEffect has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/index.tsx
  238:8  error  React Hook useMemo has a missing dependency: 'hasNoPermissions'. Either include it or remove the dependency array                                                                                                                           react-hooks/exhaustive-deps
  316:7  error  React Hook useMemo has an unnecessary dependency: 'allRulesTabs'. Either exclude it or remove the dependency array. Outer scope values like 'allRulesTabs' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/all/rules_table_filters/rules_table_filters.tsx
  48:6  error  React Hook useEffect has a missing dependency: 'reFetchTags'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/index.tsx
  117:6  error  React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked                                                                                                                react-hooks/exhaustive-deps
  158:5  error  React Hook useCallback has an unnecessary dependency: 'stepsData.current'. Either exclude it or remove the dependency array. Mutable values like 'stepsData.current' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps
  174:5  error  React Hook useCallback has an unnecessary dependency: 'stepsData.current'. Either exclude it or remove the dependency array. Mutable values like 'stepsData.current' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/details/index.tsx
  194:5  error  React Hook useMemo has an unnecessary dependency: 'ruleDetailTabs'. Either exclude it or remove the dependency array. Outer scope values like 'ruleDetailTabs' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/edit/index.tsx
  209:5  error  React Hook useMemo has an unnecessary dependency: 'stepsForm'. Either exclude it or remove the dependency array                                                                                                                                       react-hooks/exhaustive-deps
  268:6  error  React Hook useCallback has a missing dependency: 'setRule'. Either include it or remove the dependency array                                                                                                                                          react-hooks/exhaustive-deps
  323:5  error  React Hook useCallback has an unnecessary dependency: 'stepsForm.current'. Either exclude it or remove the dependency array. Mutable values like 'stepsForm.current' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps
  341:6  error  React Hook useEffect has a missing dependency: 'tabs'. Either include it or remove the dependency array                                                                                                                                               react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/add_comment/index.tsx
  62:8  error  React Hook useEffect has a missing dependency: 'form'. Either include it or remove the dependency array           react-hooks/exhaustive-deps
  73:8  error  React Hook useCallback has a missing dependency: 'postComment'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/all_cases/index.tsx
  137:5  error  React Hook useCallback has an unnecessary dependency: 'filterRefetch.current'. Either exclude it or remove the dependency array. Mutable values like 'filterRefetch.current' aren't valid dependencies because mutating them doesn't re-render the component                                  react-hooks/exhaustive-deps
  149:5  error  React Hook useCallback has missing dependencies: 'fetchCasesStatus', 'refetchCases', and 'setSelectedCases'. Either include them or remove the dependency array. Mutable values like 'filterRefetch.current' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps
  161:6  error  React Hook useEffect has missing dependencies: 'dispatchResetIsDeleted', 'dispatchResetIsUpdated', and 'refreshCases'. Either include them or remove the dependency array                                                                                                                     react-hooks/exhaustive-deps
  175:5  error  React Hook useMemo has missing dependencies: 'handleOnDeleteConfirm' and 'handleToggleModal'. Either include them or remove the dependency array                                                                                                                                              react-hooks/exhaustive-deps
  181:6  error  React Hook useCallback has a missing dependency: 'handleToggleModal'. Either include it or remove the dependency array                                                                                                                                                                        react-hooks/exhaustive-deps
  195:5  error  React Hook useCallback has a missing dependency: 'handleToggleModal'. Either include it or remove the dependency array                                                                                                                                                                        react-hooks/exhaustive-deps
  202:5  error  React Hook useCallback has a missing dependency: 'updateBulkStatus'. Either include it or remove the dependency array                                                                                                                                                                         react-hooks/exhaustive-deps
  223:5  error  React Hook useCallback has a missing dependency: 'handleUpdateCaseStatus'. Either include it or remove the dependency array                                                                                                                                                                   react-hooks/exhaustive-deps
  264:5  error  React Hook useCallback has missing dependencies: 'refreshCases' and 'setQueryParams'. Either include them or remove the dependency array                                                                                                                                                      react-hooks/exhaustive-deps
  277:5  error  React Hook useCallback has missing dependencies: 'refreshCases', 'setFilters', and 'setQueryParams'. Either include them or remove the dependency array                                                                                                                                       react-hooks/exhaustive-deps
  299:5  error  React Hook useMemo has a missing dependency: 'setSelectedCases'. Either include it or remove the dependency array                                                                                                                                                                             react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/all_cases/table_filters.tsx
   69:6  error  React Hook useEffect has missing dependencies: 'handleSelectedReporters' and 'selectedReporters'. Either include them or remove the dependency array                                                                                             react-hooks/exhaustive-deps
   75:6  error  React Hook useEffect has missing dependencies: 'handleSelectedTags' and 'selectedTags'. Either include them or remove the dependency array                                                                                                       react-hooks/exhaustive-deps
   87:5  error  React Hook useCallback has a missing dependency: 'onFilterChanged'. Either include it or remove the dependency array. If 'onFilterChanged' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
   97:5  error  React Hook useCallback has a missing dependency: 'onFilterChanged'. Either include it or remove the dependency array. If 'onFilterChanged' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  107:5  error  React Hook useCallback has a missing dependency: 'onFilterChanged'. Either include it or remove the dependency array. If 'onFilterChanged' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  116:5  error  React Hook useCallback has a missing dependency: 'onFilterChanged'. Either include it or remove the dependency array. If 'onFilterChanged' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/case_view/actions.tsx
  47:5  error  React Hook useMemo has missing dependencies: 'handleOnDeleteConfirm' and 'handleToggleModal'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/configure_cases/connectors.tsx
  71:5  error  React Hook useMemo has a missing dependency: 'handleShowEditFlyout'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/configure_cases/connectors_dropdown.tsx
  94:6  error  React Hook useMemo has a missing dependency: 'appendAddConnectorButton'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/configure_cases/field_mapping.tsx
   98:5  error  React Hook useCallback has missing dependencies: 'defaultMapping' and 'onChangeMapping'. Either include them or remove the dependency array. If 'onChangeMapping' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  106:5  error  React Hook useCallback has missing dependencies: 'defaultMapping' and 'onChangeMapping'. Either include them or remove the dependency array. If 'onChangeMapping' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/configure_cases/index.tsx
   80:73  error  React Hook useCallback has a missing dependency: 'refetchConnectors'. Either include it or remove the dependency array                                             react-hooks/exhaustive-deps
   92:5   error  React Hook useCallback has unnecessary dependencies: 'closureType', 'connectorId', and 'currentConfiguration'. Either exclude them or remove the dependency array  react-hooks/exhaustive-deps
   99:5   error  React Hook useCallback has unnecessary dependencies: 'closureType', 'connectorId', and 'currentConfiguration'. Either exclude them or remove the dependency array  react-hooks/exhaustive-deps
  116:5   error  React Hook useCallback has missing dependencies: 'connectors', 'persistCaseConfigure', and 'setConnector'. Either include them or remove the dependency array      react-hooks/exhaustive-deps
  128:5   error  React Hook useCallback has missing dependencies: 'connectors', 'persistCaseConfigure', and 'setClosureType'. Either include them or remove the dependency array    react-hooks/exhaustive-deps
  144:6   error  React Hook useEffect has a missing dependency: 'isLoadingConnectors'. Either include it or remove the dependency array                                             react-hooks/exhaustive-deps
  152:6   error  React Hook useEffect has a missing dependency: 'isLoadingConnectors'. Either include it or remove the dependency array                                             react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/connector_selector/form.tsx
  36:6  error  React Hook useEffect has a missing dependency: 'field'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/create/index.tsx
  96:6  error  React Hook useCallback has a missing dependency: 'postCase'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/open_closed_stats/index.tsx
  27:7  error  React Hook useMemo has an unnecessary dependency: 'dataTestSubj'. Either exclude it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/use_push_to_service/index.tsx
  144:6  error  React Hook useMemo has a missing dependency: 'isValidConnector'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  163:6  error  React Hook useMemo has a missing dependency: 'caseServices'. Either include it or remove the dependency array      react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/user_action_tree/index.tsx
   88:7  error  React Hook useCallback has a missing dependency: 'fetchUserActions'. Either include it or remove the dependency array                                                                                                                                               react-hooks/exhaustive-deps
  112:7  error  React Hook useCallback has an unnecessary dependency: 'handlerTimeoutId.current'. Either exclude it or remove the dependency array. Mutable values like 'handlerTimeoutId.current' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps
  158:7  error  React Hook useMemo has a missing dependency: 'handleManageMarkdownEditId'. Either include it or remove the dependency array                                                                                                                                         react-hooks/exhaustive-deps
  168:8  error  React Hook useEffect has a missing dependency: 'handleOutlineComment'. Either include it or remove the dependency array                                                                                                                                             react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/user_action_tree/user_action_markdown.tsx
   77:5  error  React Hook useCallback has a missing dependency: 'dispatch'. Either include it or remove the dependency array                                         react-hooks/exhaustive-deps
  117:5  error  React Hook useCallback has unnecessary dependencies: 'handleCancelAction' and 'handleSaveAction'. Either exclude them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/components/user_list/index.tsx
  87:5  error  React Hook useCallback has a missing dependency: 'email.body'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/configure/use_configure.tsx
  256:6  error  React Hook useCallback has missing dependencies: 'dispatchToaster', 'setClosureType', 'setConnector', 'setCurrentConfiguration', 'setFirstLoad', 'setLoading', and 'setVersion'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  314:5  error  React Hook useCallback has missing dependencies: 'dispatchToaster', 'setClosureType', 'setConnector', 'setCurrentConfiguration', 'setPersistLoading', and 'setVersion'. Either include them or remove the dependency array           react-hooks/exhaustive-deps
  319:6  error  React Hook useEffect has a missing dependency: 'refetchCaseConfigure'. Either include it or remove the dependency array                                                                                                              react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/configure/use_connectors.tsx
  53:6  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  57:6  error  React Hook useEffect has a missing dependency: 'refetchConnectors'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_bulk_update_case.tsx
  111:6  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array      react-hooks/exhaustive-deps
  124:6  error  React Hook useCallback has a missing dependency: 'dispatchUpdateCases'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_delete_cases.tsx
  113:6  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array                                        react-hooks/exhaustive-deps
  121:6  error  React Hook useCallback has an unnecessary dependency: 'state.isDisplayConfirmDeleteModal'. Either exclude it or remove the dependency array                 react-hooks/exhaustive-deps
  128:5  error  React Hook useCallback has missing dependencies: 'dispatchDeleteCases' and 'dispatchToggleDeleteModal'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  132:6  error  React Hook useCallback has a missing dependency: 'dispatchToggleDeleteModal'. Either include it or remove the dependency array                              react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_get_action_license.tsx
  68:6  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array   react-hooks/exhaustive-deps
  72:6  error  React Hook useEffect has a missing dependency: 'fetchActionLicense'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_get_case.tsx
  121:6  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  125:6  error  React Hook useEffect has a missing dependency: 'callFetch'. Either include it or remove the dependency array          react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_get_case_user_actions.tsx
  213:5  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array     react-hooks/exhaustive-deps
  220:6  error  React Hook useEffect has a missing dependency: 'fetchCaseUserActions'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_get_cases.tsx
  187:6   error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array                     react-hooks/exhaustive-deps
  189:71  error  React Hook useEffect has a missing dependency: 'fetchCases'. Either include it or remove the dependency array                            react-hooks/exhaustive-deps
  227:5   error  React Hook useCallback has missing dependencies: 'dispatchToaster' and 'fetchCases'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  232:6   error  React Hook useCallback has a missing dependency: 'fetchCases'. Either include it or remove the dependency array                          react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_get_cases_status.tsx
  72:6  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  76:6  error  React Hook useEffect has a missing dependency: 'fetchCasesStatus'. Either include it or remove the dependency array   react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_get_reporters.tsx
  82:6  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  86:6  error  React Hook useEffect has a missing dependency: 'fetchReporters'. Either include it or remove the dependency array     react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_get_tags.tsx
  92:6  error  React Hook useEffect has a missing dependency: 'callFetch'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_post_case.tsx
  89:6  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_post_comment.tsx
  82:5  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_post_push_to_service.tsx
  149:5  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_update_case.tsx
  121:5  error  React Hook useCallback has missing dependencies: 'caseId' and 'dispatchToaster'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_update_comment.tsx
  114:5  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/alerts_viewer/index.tsx
  34:5  error  React Hook useCallback has a missing dependency: 'defaultNumberFormat'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/charts/common.tsx
  104:80  error  React Hook useMemo has a missing dependency: 'defaultTheme'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx
  128:7  error  React Hook useCallback has missing dependencies: 'dispatch' and 'onAddedToTimeline'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/drag_and_drop/draggable_wrapper.tsx
  129:7  error  React Hook useEffect has a missing dependency: 'unRegisterProvider'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/events_viewer/index.tsx
  85:6  error  React Hook useEffect has missing dependencies: 'columns', 'createTimeline', 'deleteEventQuery', 'id', 'itemsPerPage', 'showCheckboxes', 'showRowRenderers', and 'sort'. Either include them or remove the dependency array. If 'createTimeline' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/generic_downloader/index.tsx
  98:6  error  React Hook useEffect has missing dependencies: 'dispatchToaster', 'exportSelectedData', 'filename', 'onExportFailure', and 'onExportSuccess'. Either include them or remove the dependency array. If 'exportSelectedData' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/header_page/editable_title.tsx
  60:6  error  React Hook useCallback has a missing dependency: 'onSubmit'. Either include it or remove the dependency array. If 'onSubmit' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/help_menu/index.tsx
  48:6  error  React Hook useEffect has missing dependencies: 'chrome', 'docLinks.ELASTIC_WEBSITE_URL', and 'docLinks.links.siem.guide'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/import_data_modal/index.tsx
  112:6  error  React Hook useCallback has missing dependencies: 'cleanupAndCloseModal', 'dispatchToaster', 'errorMessage', 'failedDetailed', 'importComplete', 'importData', and 'successMessage'. Either include them or remove the dependency array. If 'importData' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/links/index.tsx
  245:5  error  React Hook useMemo has an unnecessary dependency: 'defaultNameMapping'. Either exclude it or remove the dependency array. Outer scope values like 'defaultNameMapping' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/markdown_editor/index.tsx
  138:7  error  React Hook useMemo has missing dependencies: 'handleOnChange', 'onClickTimeline', and 'setCursorPosition'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/matrix_histogram/index.tsx
  128:5  error  React Hook useMemo has a missing dependency: 'setAbsoluteRangeDatePickerTarget'. Either include it or remove the dependency array                                                                                                                                                                                            react-hooks/exhaustive-deps
  148:5  error  React Hook useCallback has missing dependencies: 'defaultStackByOption' and 'stackByOptions'. Either include them or remove the dependency array. If 'setSelectedStackByOption' needs the current value of 'stackByOptions', you can also switch to useReducer instead of useState and read 'stackByOptions' in the reducer  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/ml/anomaly/use_anomalies_table_data.ts
  124:6  error  React Hook useEffect has missing dependencies: 'anomalyScore', 'criteriaFields', 'dispatchToaster', 'influencers', 'siemJobIds', 'threshold', and 'timeZone'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  125:5  error  React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked                                                                          react-hooks/exhaustive-deps
  126:5  error  React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked                                                                          react-hooks/exhaustive-deps
  131:5  error  React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked                                                                          react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/ml/permissions/ml_capabilities_provider.tsx
  63:6  error  React Hook useEffect has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/ml_popover/hooks/use_siem_jobs.tsx
  77:6  error  React Hook useEffect has missing dependencies: 'dispatchToaster' and 'siemDefaultIndex'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.tsx
  49:6  error  React Hook useEffect has missing dependencies: 'onSelectedGroupsChanged' and 'selectedGroups'. Either include them or remove the dependency array. If 'onSelectedGroupsChanged' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  49:7  error  React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked                                                                                                                                              react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/navigation/index.tsx
  57:6  error  React Hook useEffect has missing dependencies: 'detailName', 'flowTarget', 'pageName', and 'tabName'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/search_bar/index.tsx
  137:7  error  React Hook useCallback has missing dependencies: 'filterManager' and 'updateSearch'. Either include them or remove the dependency array. If 'updateSearch' changes too often, find the parent component that defines it and wrap that definition in useCallback                   react-hooks/exhaustive-deps
  156:7  error  React Hook useCallback has a missing dependency: 'updateSearch'. Either include it or remove the dependency array. If 'updateSearch' changes too often, find the parent component that defines it and wrap that definition in useCallback                                         react-hooks/exhaustive-deps
  163:7  error  React Hook useCallback has a missing dependency: 'setSavedQuery'. Either include it or remove the dependency array. If 'setSavedQuery' changes too often, find the parent component that defines it and wrap that definition in useCallback                                       react-hooks/exhaustive-deps
  199:7  error  React Hook useCallback has missing dependencies: 'filterManager' and 'updateSearch'. Either include them or remove the dependency array. If 'updateSearch' changes too often, find the parent component that defines it and wrap that definition in useCallback                   react-hooks/exhaustive-deps
  221:8  error  React Hook useCallback has a missing dependency: 'updateSearch'. Either include it or remove the dependency array. If 'updateSearch' changes too often, find the parent component that defines it and wrap that definition in useCallback                                         react-hooks/exhaustive-deps
  244:8  error  React Hook useEffect has missing dependencies: 'filterManager', 'id', and 'setSearchBarFilter'. Either include them or remove the dependency array. If 'setSearchBarFilter' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/stat_items/index.tsx
  186:6  error  React Hook useEffect has missing dependencies: 'from', 'id', 'mappings', 'narrowDateRange', and 'to'. Either include them or remove the dependency array. If 'setStatItemsProps' needs the current value of 'mappings', you can also switch to useReducer instead of useState and read 'mappings' in the reducer  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/super_date_picker/index.tsx
  120:7  error  React Hook useCallback has missing dependencies: 'queries' and 'updateReduxTime'. Either include them or remove the dependency array. If 'updateReduxTime' changes too often, find the parent component that defines it and wrap that definition in useCallback                                react-hooks/exhaustive-deps
  139:7  error  React Hook useCallback has missing dependencies: 'queries', 'setDuration', 'startAutoReload', and 'stopAutoReload'. Either include them or remove the dependency array. If 'setDuration' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  178:7  error  React Hook useCallback has missing dependencies: 'id', 'timelineId', and 'updateReduxTime'. Either include them or remove the dependency array. If 'updateReduxTime' changes too often, find the parent component that defines it and wrap that definition in useCallback                      react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/toasters/index.test.tsx
  72:12  error  React Hook useEffect has missing dependencies: 'dispatch' and 'toasts.length'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/url_state/use_url_state.tsx
  209:6  error  React Hook useEffect has missing dependencies: 'handleInitialize' and 'search'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  213:6  error  React Hook useEffect has missing dependencies: 'detailName' and 'navTabs'. Either include them or remove the dependency array       react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx
  38:6  error  React Hook useEffect has a missing dependency: 'deleteQuery'. Either include it or remove the dependency array. If 'deleteQuery' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/containers/events/last_event_time/index.ts
  87:6  error  React Hook useEffect has a missing dependency: 'fetchLastEventTime'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/containers/global_time/index.tsx
  62:6  error  React Hook useEffect has missing dependencies: 'deleteAllQuery' and 'isInitializing'. Either include them or remove the dependency array. If 'deleteAllQuery' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/containers/matrix_histogram/index.ts
  105:6  error  React Hook useEffect has missing dependencies: 'apolloClient' and 'dispatchToaster'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/containers/source/index.tsx
  176:6  error  React Hook useEffect has a missing dependency: 'fetchSource'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/hooks/use_add_to_timeline.tsx
  162:6  error  React Hook useCallback has a missing dependency: 'fieldName'. Either include it or remove the dependency array. Outer scope values like '_sensorApiSingleton' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/hooks/use_index_patterns.tsx
  48:6  error  React Hook useEffect has missing dependencies: 'dispatchToaster' and 'savedObjects'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/lib/connectors/components/connector_flyout/index.tsx
  56:8  error  React Hook useEffect has missing dependencies: 'apiUrl' and 'editActionSecrets'. Either include them or remove the dependency array. If 'editActionSecrets' changes too often, find the parent component that defines it and wrap that definition in useCallback                 react-hooks/exhaustive-deps
  67:7  error  React Hook useCallback has a missing dependency: 'editActionConfig'. Either include it or remove the dependency array. If 'editActionConfig' changes too often, find the parent component that defines it and wrap that definition in useCallback                                react-hooks/exhaustive-deps
  76:7  error  React Hook useCallback has missing dependencies: 'configKeysWithDefault' and 'editActionConfig'. Either include them or remove the dependency array. If 'editActionConfig' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  81:7  error  React Hook useCallback has a missing dependency: 'editActionSecrets'. Either include it or remove the dependency array. If 'editActionSecrets' changes too often, find the parent component that defines it and wrap that definition in useCallback                              react-hooks/exhaustive-deps
  90:7  error  React Hook useCallback has a missing dependency: 'editActionSecrets'. Either include it or remove the dependency array. If 'editActionSecrets' changes too often, find the parent component that defines it and wrap that definition in useCallback                              react-hooks/exhaustive-deps
  99:7  error  React Hook useCallback has a missing dependency: 'editActionConfig'. Either include it or remove the dependency array. If 'editActionConfig' changes too often, find the parent component that defines it and wrap that definition in useCallback                                react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/lib/kibana/hooks.ts
  92:6  error  React Hook useCallback has a missing dependency: 'dispatchToaster'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  96:6  error  React Hook useEffect has a missing dependency: 'fetchUser'. Either include it or remove the dependency array          react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/utils/route/spy_routes.tsx
  35:8  error  React Hook useEffect has missing dependencies: 'dispatch' and 'isInitializing'. Either include them or remove the dependency array                                               react-hooks/exhaustive-deps
  84:8  error  React Hook useEffect has missing dependencies: 'dispatch', 'history', 'isInitializing', 'route.pathName', and 'route.state'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/utils/timeline/use_show_timeline.tsx
  28:6  error  React Hook useEffect has a missing dependency: 'showTimeline'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/endpoint_alerts/view/details/overview/index.tsx
  90:5  error  React Hook useCallback has missing dependencies: 'history' and 'queryParams'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/hosts/containers/hosts/first_last_seen/index.ts
  82:6  error  React Hook useEffect has a missing dependency: 'fetchFirstLastSeenHost'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/network/components/embeddables/embedded_map.tsx
  156:6  error  React Hook useEffect has missing dependencies: 'dispatchToaster', 'endDate', 'filters', 'portalNode', 'query', 'services.embeddable', 'setQuery', 'siemDefaultIndices', and 'startDate'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  163:6  error  React Hook useEffect has a missing dependency: 'embeddable'. Either include it or remove the dependency array                                                                                                                                react-hooks/exhaustive-deps
  169:6  error  React Hook useEffect has a missing dependency: 'embeddable'. Either include it or remove the dependency array                                                                                                                                react-hooks/exhaustive-deps
  180:6  error  React Hook useEffect has a missing dependency: 'embeddable'. Either include it or remove the dependency array                                                                                                                                react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/network/components/embeddables/map_tool_tip/map_tool_tip.tsx
  81:6  error  React Hook useEffect has missing dependencies: 'features', 'getLayerName', 'isLoadingNextFeature', 'loadFeatureGeometry', and 'loadFeatureProperties'. Either include them or remove the dependency array. If 'getLayerName' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  83:5  error  React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked                                                                                                                                                                                           react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/network/components/source_destination/country_flag.tsx
  34:6  error  React Hook useEffect has a missing dependency: 'displayCountryNameOnHover'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/network/components/tls_table/index.tsx
  111:62  error  React Hook useMemo has an unnecessary dependency: 'tlsTableId'. Either exclude it or remove the dependency array. Outer scope values like 'tlsTableId' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/network/components/users_table/index.tsx
  117:78  error  React Hook useMemo has an unnecessary dependency: 'usersTableId'. Either exclude it or remove the dependency array. Outer scope values like 'usersTableId' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/overview/components/alerts_by_category/index.tsx
  74:6  error  React Hook useEffect has a missing dependency: 'deleteQuery'. Either include it or remove the dependency array. If 'deleteQuery' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  98:5  error  React Hook useMemo has a missing dependency: 'defaultNumberFormat'. Either include it or remove the dependency array                                                                                                                   react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/overview/components/recent_timelines/index.tsx
  85:8  error  React Hook useEffect has a missing dependency: 'fetchAllTimeline'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/overview/components/signals_by_category/index.tsx
  64:5  error  React Hook useCallback has a missing dependency: 'setAbsoluteRangeDatePickerTarget'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/fields_browser/field_browser.tsx
  183:6  error  React Hook useEffect has a missing dependency: 'scrollViews'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/fields_browser/index.tsx
  111:7  error  React Hook useCallback has unnecessary dependencies: 'filterInput' and 'inputTimeoutId.current'. Either exclude them or remove the dependency array. Mutable values like 'inputTimeoutId.current' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps
  129:8  error  React Hook useCallback has a missing dependency: 'onUpdateColumns'. Either include it or remove the dependency array. If 'onUpdateColumns' changes too often, find the parent component that defines it and wrap that definition in useCallback                                    react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/flyout/pane/index.tsx
  68:5  error  React Hook useCallback has a missing dependency: 'timelineId'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  75:5  error  React Hook useMemo has a missing dependency: 'width'. Either include it or remove the dependency array           react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/open_timeline/edit_timeline_actions.tsx
  19:6  error  React Hook useCallback has an unnecessary dependency: 'actionItem'. Either exclude it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx
  50:5  error  React Hook useCallback has a missing dependency: 'tableRef'. Either include it or remove the dependency array. Mutable values like 'tableRef.current' aren't valid dependencies because mutating them doesn't re-render the component  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/open_timeline/index.tsx
  128:8  error  React Hook useCallback has a missing dependency: 'fetchAllTimeline'. Either include it or remove the dependency array                                                                                                                                                                     react-hooks/exhaustive-deps
  194:8  error  React Hook useCallback has a missing dependency: 'resetSelectionState'. Either include it or remove the dependency array                                                                                                                                                                  react-hooks/exhaustive-deps
  247:7  error  React Hook useCallback has missing dependencies: 'closeModalTimeline', 'isModal', and 'onOpenTimeline'. Either include them or remove the dependency array. If 'closeModalTimeline' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/open_timeline/use_timeline_types.tsx
  82:6  error  React Hook useMemo has missing dependencies: 'getFilterOrTabs' and 'onFilterClicked'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  98:6  error  React Hook useMemo has missing dependencies: 'getFilterOrTabs' and 'onFilterClicked'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/body/column_headers/index.tsx
  154:5  error  React Hook useMemo has a missing dependency: 'onColumnSorted'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/body/events/event_column_view.tsx
  92:8  error  React Hook useMemo has a missing dependency: 'id'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/body/events/stateful_event.tsx
  177:6  error  React Hook useEffect has missing dependencies: 'initialRender' and 'maxDelay'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/body/stateful_body.tsx
   93:7   error  React Hook useCallback has a missing dependency: 'addNoteToEvent'. Either include it or remove the dependency array           react-hooks/exhaustive-deps
  130:7   error  React Hook useCallback has a missing dependency: 'updateSort'. Either include it or remove the dependency array               react-hooks/exhaustive-deps
  135:7   error  React Hook useCallback has a missing dependency: 'removeColumn'. Either include it or remove the dependency array             react-hooks/exhaustive-deps
  140:7   error  React Hook useCallback has a missing dependency: 'applyDeltaToColumnWidth'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  143:89  error  React Hook useCallback has a missing dependency: 'pinEvent'. Either include it or remove the dependency array                 react-hooks/exhaustive-deps
  145:95  error  React Hook useCallback has a missing dependency: 'unPinEvent'. Either include it or remove the dependency array               react-hooks/exhaustive-deps
  147:89  error  React Hook useCallback has a missing dependency: 'updateNote'. Either include it or remove the dependency array               react-hooks/exhaustive-deps
  151:7   error  React Hook useCallback has a missing dependency: 'updateColumns'. Either include it or remove the dependency array            react-hooks/exhaustive-deps
  159:8   error  React Hook useEffect has a missing dependency: 'onSelectAll'. Either include it or remove the dependency array                react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/data_providers/provider_item_badge.tsx
  69:8  error  React Hook useCallback has a missing dependency: 'closePopover'. Either include it or remove the dependency array      react-hooks/exhaustive-deps
  74:8  error  React Hook useCallback has a missing dependency: 'closePopover'. Either include it or remove the dependency array      react-hooks/exhaustive-deps
  98:7  error  React Hook useEffect has a missing dependency: 'unRegisterProvider'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/fetch_kql_timeline.tsx
  41:8  error  React Hook useEffect has missing dependencies: 'indexPattern', 'inputId', and 'setTimelineQuery'. Either include them or remove the dependency array. If 'setTimelineQuery' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/footer/index.tsx
  263:6  error  React Hook useEffect has missing dependencies: 'getUpdatedAt', 'paginationLoading', and 'updatedAt'. Either include them or remove the dependency array. If 'getUpdatedAt' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/index.tsx
   80:7  error  React Hook useCallback has a missing dependency: 'removeProvider'. Either include it or remove the dependency array                                                                                                                                             react-hooks/exhaustive-deps
   91:7  error  React Hook useCallback has a missing dependency: 'updateDataProviderEnabled'. Either include it or remove the dependency array                                                                                                                                  react-hooks/exhaustive-deps
  102:7  error  React Hook useCallback has a missing dependency: 'updateDataProviderExcluded'. Either include it or remove the dependency array                                                                                                                                 react-hooks/exhaustive-deps
  116:7  error  React Hook useCallback has a missing dependency: 'onDataProviderEdited'. Either include it or remove the dependency array                                                                                                                                       react-hooks/exhaustive-deps
  121:7  error  React Hook useCallback has a missing dependency: 'updateItemsPerPage'. Either include it or remove the dependency array                                                                                                                                         react-hooks/exhaustive-deps
  143:7  error  React Hook useCallback has missing dependencies: 'removeColumn' and 'upsertColumn'. Either include them or remove the dependency array. If 'upsertColumn' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  150:8  error  React Hook useEffect has missing dependencies: 'createTimeline' and 'id'. Either include them or remove the dependency array. If 'createTimeline' changes too often, find the parent component that defines it and wrap that definition in useCallback          react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/insert_timeline_popover/index.tsx
  55:6  error  React Hook useEffect has missing dependencies: 'dispatch' and 'onTimelineChange'. Either include them or remove the dependency array. If 'onTimelineChange' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/insert_timeline_popover/use_insert_timeline.tsx
  31:5  error  React Hook useCallback has missing dependencies: 'basePath', 'cursorPosition.end', 'cursorPosition.start', and 'fieldName'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
  37:5  error  React Hook useCallback has an unnecessary dependency: 'cursorPosition'. Either exclude it or remove the dependency array                                                        react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/properties/helpers.tsx
  142:6  error  React Hook useCallback has a missing dependency: 'savedObjectId'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/properties/index.tsx
  87:8  error  React Hook useCallback has a missing dependency: 'onClosePopover'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/query_bar/index.tsx
  123:8  error  React Hook useEffect has missing dependencies: 'filterManager', 'filters', and 'setFilters'. Either include them or remove the dependency array. If 'setFilters' changes too often, find the parent component that defines it and wrap that definition in useCallback                                          react-hooks/exhaustive-deps
  132:8  error  React Hook useEffect has a missing dependency: 'filterManager'. Either include it or remove the dependency array                                                                                                                                                                                               react-hooks/exhaustive-deps
  191:8  error  React Hook useEffect has missing dependencies: 'filters' and 'savedQueryServices'. Either include them or remove the dependency array. If 'setSavedQuery' needs the current value of 'filters', you can also switch to useReducer instead of useState and read 'filters' in the reducer                        react-hooks/exhaustive-deps
  206:7  error  React Hook useCallback has a missing dependency: 'setKqlFilterQueryDraft'. Either include it or remove the dependency array. If 'setKqlFilterQueryDraft' changes too often, find the parent component that defines it and wrap that definition in useCallback                                                  react-hooks/exhaustive-deps
  235:7  error  React Hook useCallback has missing dependencies: 'applyKqlFilterQuery', 'setKqlFilterQueryDraft', and 'updateReduxTime'. Either include them or remove the dependency array. If 'setKqlFilterQueryDraft' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  277:7  error  React Hook useCallback has a missing dependency: 'setSavedQueryId'. Either include it or remove the dependency array. If 'setSavedQueryId' changes too often, find the parent component that defines it and wrap that definition in useCallback                                                                react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/search_or_filter/index.tsx
   81:7  error  React Hook useCallback has a missing dependency: 'applyKqlFilterQuery'. Either include it or remove the dependency array. If 'applyKqlFilterQuery' changes too often, find the parent component that defines it and wrap that definition in useCallback        react-hooks/exhaustive-deps
   93:7  error  React Hook useCallback has a missing dependency: 'setKqlFilterQueryDraft'. Either include it or remove the dependency array. If 'setKqlFilterQueryDraft' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps
  102:7  error  React Hook useCallback has a missing dependency: 'setFilters'. Either include it or remove the dependency array. If 'setFilters' changes too often, find the parent component that defines it and wrap that definition in useCallback                          react-hooks/exhaustive-deps
  111:7  error  React Hook useCallback has a missing dependency: 'setSavedQueryId'. Either include it or remove the dependency array. If 'setSavedQueryId' changes too often, find the parent component that defines it and wrap that definition in useCallback                react-hooks/exhaustive-deps
  120:7  error  React Hook useCallback has a missing dependency: 'updateEventType'. Either include it or remove the dependency array. If 'updateEventType' changes too often, find the parent component that defines it and wrap that definition in useCallback                react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/timeline/selectable_timeline/index.tsx
  261:6  error  React Hook useEffect has a missing dependency: 'fetchAllTimeline'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/containers/all/index.tsx
  171:5  error  React Hook useCallback has missing dependencies: 'dispatch' and 'dispatchToaster'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

 265 problems (265 errors, 0 warnings)
  258 errors and 0 warnings potentially fixable with the `--fix` option.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

After running eslint with the --fix option, which fixes errors that can be fixed automatically:

✖ 10 problems (10 errors, 0 warnings)
raustin-mbp:kibana raustin$ yarn lint:es --fix
yarn run v1.22.0
$ node scripts/eslint --fix

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/alerts/pages/detection_engine/rules/create/index.tsx
  117:6  error  React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/cases/containers/use_get_tags.tsx
  62:21  error  React Hook useCallback does nothing when called with only one argument. Did you forget to pass an array of dependencies?  react-hooks/exhaustive-deps
  62:21  error  'useCallback' is not defined                                                                                              no-undef

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/markdown_editor/index.tsx
  98:11  error  The 'setCursorPosition' function makes the dependencies of useMemo Hook (at line 138) change on every render. Move it inside the useMemo callback. Alternatively, wrap the 'setCursorPosition' definition into its own useCallback() Hook  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/components/url_state/use_url_state.tsx
  59:9  error  The 'handleInitialize' function makes the dependencies of useEffect Hook (at line 209) change on every render. Move it inside the useEffect callback. Alternatively, wrap the 'handleInitialize' definition into its own useCallback() Hook  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/containers/events/last_event_time/index.ts
  47:3  error  The 'fetchLastEventTime' function makes the dependencies of useEffect Hook (at line 87) change on every render. Move it inside the useEffect callback. Alternatively, wrap the 'fetchLastEventTime' definition into its own useCallback() Hook  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/common/containers/source/index.tsx
  134:3  error  The 'fetchSource' function makes the dependencies of useEffect Hook (at line 176) change on every render. Move it inside the useEffect callback. Alternatively, wrap the 'fetchSource' definition into its own useCallback() Hook  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/hosts/containers/hosts/first_last_seen/index.ts
  44:3  error  The 'fetchFirstLastSeenHost' function makes the dependencies of useEffect Hook (at line 82) change on every render. Move it inside the useEffect callback. Alternatively, wrap the 'fetchFirstLastSeenHost' definition into its own useCallback() Hook  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/fields_browser/field_browser.tsx
  153:9  error  The 'scrollViews' function makes the dependencies of useEffect Hook (at line 183) change on every render. Move it inside the useEffect callback. Alternatively, wrap the 'scrollViews' definition into its own useCallback() Hook  react-hooks/exhaustive-deps

/Users/raustin/Code/elastic/kibana/x-pack/plugins/siem/public/timelines/components/open_timeline/use_timeline_types.tsx
  29:84  error  React Hook useCallback does nothing when called with only one argument. Did you forget to pass an array of dependencies?  react-hooks/exhaustive-deps

✖ 10 problems (10 errors, 0 warnings)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Finally, I made the remaining fixes by hand.

Checklist

Delete any items that are not applicable to this PR.

  • Spot check for performance issues (@patrykkopycinski perhaps you could provide a few suggested features for me to check?)

For maintainers

@oatkiller oatkiller requested review from a team as code owners June 1, 2020 16:18
@oatkiller oatkiller added the release_note:skip Skip the PR/issue when compiling release notes label Jun 1, 2020
@oatkiller oatkiller marked this pull request as draft June 1, 2020 16:30
@oatkiller
Copy link
Contributor Author

Superseded by #68470

@oatkiller oatkiller closed this Jun 7, 2020
@oatkiller oatkiller deleted the restore-rules-of-hooks branch March 31, 2022 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant