From d28a6eb65ae8b77fe0e85f5c3c7c44f1ab51196f Mon Sep 17 00:00:00 2001 From: Monica Wheeler Date: Mon, 17 Jun 2024 11:05:09 -0700 Subject: [PATCH] Disable lint warnings for dependencies (#1889) * chore: update Storybook source path for local and prod environment * fix: resolve linting errors * fix: revert preview-head file change --------- Co-authored-by: Julian Skinner --- packages/sage-react/lib/Drawer/Drawer.jsx | 2 ++ packages/sage-react/lib/Input/Input.jsx | 2 ++ packages/sage-react/lib/Input/Input.story.jsx | 2 ++ packages/sage-react/lib/PanelControls/PanelControls.story.jsx | 2 ++ packages/sage-react/lib/Table/Table.jsx | 2 ++ packages/sage-react/lib/Table/TableRow.jsx | 2 ++ packages/sage-react/lib/Toast/Toast.jsx | 2 ++ packages/sage-react/lib/Toggle/Switch.story.jsx | 2 ++ packages/sage-react/lib/Tooltip/TooltipElement.jsx | 2 ++ packages/sage-react/lib/Typeahead/Typeahead.jsx | 2 ++ packages/sage-react/lib/common/hooks/useDebounceEffect.jsx | 2 ++ packages/sage-react/lib/common/hooks/useFocusTrap.jsx | 2 ++ 12 files changed, 24 insertions(+) diff --git a/packages/sage-react/lib/Drawer/Drawer.jsx b/packages/sage-react/lib/Drawer/Drawer.jsx index 9eb2fba58e..5a9be494f5 100644 --- a/packages/sage-react/lib/Drawer/Drawer.jsx +++ b/packages/sage-react/lib/Drawer/Drawer.jsx @@ -11,6 +11,8 @@ import { DRAWER_END_COLLAPSE, } from './configs'; +/* eslint-disable react-hooks/exhaustive-deps */ + export const Drawer = ({ active, children, diff --git a/packages/sage-react/lib/Input/Input.jsx b/packages/sage-react/lib/Input/Input.jsx index 7c088dcdcd..ac235bbdc7 100644 --- a/packages/sage-react/lib/Input/Input.jsx +++ b/packages/sage-react/lib/Input/Input.jsx @@ -8,6 +8,8 @@ import { INPUT_TYPE } from './configs'; +/* eslint-disable react-hooks/exhaustive-deps */ + export const Input = React.forwardRef(({ autocomplete, className, diff --git a/packages/sage-react/lib/Input/Input.story.jsx b/packages/sage-react/lib/Input/Input.story.jsx index b29edf1c46..b08f1d74e2 100644 --- a/packages/sage-react/lib/Input/Input.story.jsx +++ b/packages/sage-react/lib/Input/Input.story.jsx @@ -4,6 +4,8 @@ import { SageTokens } from '../configs'; import { Input } from './Input'; import { Popover } from '../Popover'; +/* eslint-disable no-console */ + export default { title: 'Sage/Input', component: Input, diff --git a/packages/sage-react/lib/PanelControls/PanelControls.story.jsx b/packages/sage-react/lib/PanelControls/PanelControls.story.jsx index 8da73796f4..c305451688 100644 --- a/packages/sage-react/lib/PanelControls/PanelControls.story.jsx +++ b/packages/sage-react/lib/PanelControls/PanelControls.story.jsx @@ -9,6 +9,8 @@ import { Table } from '../Table'; import { getNews } from '../services/newsapi'; import { PanelControls } from './PanelControls'; +/* eslint-disable react-hooks/exhaustive-deps */ + // TODO: Consider how select all affects all items // when only one page is currently selected diff --git a/packages/sage-react/lib/Table/Table.jsx b/packages/sage-react/lib/Table/Table.jsx index 9292f6447d..72d4d3e756 100644 --- a/packages/sage-react/lib/Table/Table.jsx +++ b/packages/sage-react/lib/Table/Table.jsx @@ -9,6 +9,8 @@ import { TableRow } from './TableRow'; import { SELECTION_TYPES } from '../PanelControls/configs'; import { Checkbox } from '../Toggle'; +/* eslint-disable react-hooks/exhaustive-deps */ + // // Tables are built out from a provided set of rows. // These rows can be provided in a variety of formats, diff --git a/packages/sage-react/lib/Table/TableRow.jsx b/packages/sage-react/lib/Table/TableRow.jsx index ece694d29a..9fca73574c 100644 --- a/packages/sage-react/lib/Table/TableRow.jsx +++ b/packages/sage-react/lib/Table/TableRow.jsx @@ -7,6 +7,8 @@ import { cellPropTypes } from './configs'; import { TableHelpers } from '../helpers'; import { Checkbox } from '../Toggle'; +/* eslint-disable react-hooks/exhaustive-deps */ + export const TableRow = ({ className, cells, diff --git a/packages/sage-react/lib/Toast/Toast.jsx b/packages/sage-react/lib/Toast/Toast.jsx index 0941f7f2cd..7e7f4e2a6e 100644 --- a/packages/sage-react/lib/Toast/Toast.jsx +++ b/packages/sage-react/lib/Toast/Toast.jsx @@ -6,6 +6,8 @@ import { SageTokens } from '../configs'; import { Icon } from '../Icon'; import { TOAST_TYPES } from './configs'; +/* eslint-disable react-hooks/exhaustive-deps */ + export const Toast = ({ className, description, diff --git a/packages/sage-react/lib/Toggle/Switch.story.jsx b/packages/sage-react/lib/Toggle/Switch.story.jsx index 7198782cb2..0dd51281ab 100644 --- a/packages/sage-react/lib/Toggle/Switch.story.jsx +++ b/packages/sage-react/lib/Toggle/Switch.story.jsx @@ -3,6 +3,8 @@ import { disableArgs, selectArgs } from '../story-support/helpers'; import { Switch } from './Switch'; import { Toggle } from './Toggle'; +/* eslint-disable react/forbid-foreign-prop-types */ + export default { title: 'Sage/Switch', component: Switch, diff --git a/packages/sage-react/lib/Tooltip/TooltipElement.jsx b/packages/sage-react/lib/Tooltip/TooltipElement.jsx index be4b0c8263..52398cb63a 100644 --- a/packages/sage-react/lib/Tooltip/TooltipElement.jsx +++ b/packages/sage-react/lib/Tooltip/TooltipElement.jsx @@ -5,6 +5,8 @@ import { TOOLTIP_POSITIONS } from './configs'; +/* eslint-disable react-hooks/exhaustive-deps */ + const TOOLTIP_DISTANCE = 8; export const TooltipElement = ({ diff --git a/packages/sage-react/lib/Typeahead/Typeahead.jsx b/packages/sage-react/lib/Typeahead/Typeahead.jsx index 1a918cf2be..195e7b8a44 100644 --- a/packages/sage-react/lib/Typeahead/Typeahead.jsx +++ b/packages/sage-react/lib/Typeahead/Typeahead.jsx @@ -5,6 +5,8 @@ import { Search } from '../Search'; import { useFocusTrap, useDebounceEffect } from '../common/hooks'; import { TypeaheadPanel } from './TypeaheadPanel'; +/* eslint-disable react-hooks/exhaustive-deps */ + const A11Y_ID = uuid(); export const Typeahead = ({ diff --git a/packages/sage-react/lib/common/hooks/useDebounceEffect.jsx b/packages/sage-react/lib/common/hooks/useDebounceEffect.jsx index 3a538030c2..447f9bc06a 100644 --- a/packages/sage-react/lib/common/hooks/useDebounceEffect.jsx +++ b/packages/sage-react/lib/common/hooks/useDebounceEffect.jsx @@ -1,5 +1,7 @@ import { useEffect, useCallback } from 'react'; +/* eslint-disable react-hooks/exhaustive-deps */ + export const useDebounceEffect = (effect, deps, delay = 250) => { const callback = useCallback(effect, deps); diff --git a/packages/sage-react/lib/common/hooks/useFocusTrap.jsx b/packages/sage-react/lib/common/hooks/useFocusTrap.jsx index 20c40b13e5..d02df2b295 100644 --- a/packages/sage-react/lib/common/hooks/useFocusTrap.jsx +++ b/packages/sage-react/lib/common/hooks/useFocusTrap.jsx @@ -1,6 +1,8 @@ import { useEffect } from 'react'; import { createFocusTrap } from 'focus-trap'; +/* eslint-disable react-hooks/exhaustive-deps */ + /** * * @param {Boolean} active - React boolean state