diff --git a/.eslintrc.json b/.eslintrc.json index 2f6fe2f84..27c826549 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,7 +18,8 @@ "@redhat-cloud-services/eslint-config-redhat-cloud-services", "eslint:recommended", "plugin:@typescript-eslint/recommended", - "plugin:react/recommended" + "plugin:react/recommended", + "plugin:react-hooks/recommended" ], "parserOptions": { // "project": ["./tsconfig.json"], @@ -128,6 +129,7 @@ "error", "as-needed" ], + "react-hooks/exhaustive-deps": 0, // "warn", "react/display-name": 0, "react/no-unescaped-entities": ["error", { "forbid": [">", "}"]}], "react/no-unknown-property": ["error", { "ignore": ["key"]}], diff --git a/src/components/pageTitle/pageTitle.tsx b/src/components/pageTitle/pageTitle.tsx index 3754367c6..897bf5748 100644 --- a/src/components/pageTitle/pageTitle.tsx +++ b/src/components/pageTitle/pageTitle.tsx @@ -12,7 +12,7 @@ interface PageTitleOwnProps { type PageTitleProps = PageTitleOwnProps & WrappedComponentProps; const PageTitleBase: React.FC = ({ children = null, intl }) => { - const getPageTitle = () => { + const usePageTitle = () => { const pathname = usePathname(); switch (pathname) { case formatPath(routes.explorer.path): @@ -25,7 +25,7 @@ const PageTitleBase: React.FC = ({ children = null, intl }) => { }; // Set page title - document.title = intl.formatMessage(getPageTitle()); + document.title = intl.formatMessage(usePageTitle()); return <>{children}; }; diff --git a/src/routes/views/components/dataToolbar/dataToolbar.tsx b/src/routes/views/components/dataToolbar/dataToolbar.tsx index e3c9db9a2..f5229df2d 100644 --- a/src/routes/views/components/dataToolbar/dataToolbar.tsx +++ b/src/routes/views/components/dataToolbar/dataToolbar.tsx @@ -910,7 +910,7 @@ export class DataToolbarBase extends React.Component { showToolbarItem={currentCategory === tagKey && currentTagKey === tagKeyOption.key} >