From c49723056acec489765acb54bae3889ac07f25af Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Thu, 18 Apr 2024 08:18:36 -0600 Subject: refactor: bring down eslint warnings to zero (#1714) - install `@eslint-react/eslint-plugin` dependency - configure `@eslint-react/eslint-plugin` in eslint config - modernize `lint` command in `package.json` - disable or fix various reported lint issues - fix `div` being nested in `p` for settings - replace deprecated `event.keyCode` with `event.key` - update isEscKeyPress method and unit tests which used deprecated `event.keyCode` - allow `eslint` v8 as peer dependency for `@eslint-react/eslint-plugin` --- src/components/ui/FAB.tsx | 1 + src/components/ui/SearchInput.tsx | 1 + src/components/ui/Tabs/Tabs.tsx | 7 +++++-- src/components/ui/button/index.tsx | 2 +- src/components/ui/imageUpload/index.tsx | 2 ++ src/components/ui/input/index.tsx | 2 +- src/components/ui/select/index.tsx | 2 ++ src/components/ui/textarea/index.tsx | 7 +++---- 8 files changed, 16 insertions(+), 8 deletions(-) (limited to 'src/components/ui') diff --git a/src/components/ui/FAB.tsx b/src/components/ui/FAB.tsx index b4eeace8b..1e9ff9022 100644 --- a/src/components/ui/FAB.tsx +++ b/src/components/ui/FAB.tsx @@ -36,6 +36,7 @@ class Button extends Component { }; return ( + // eslint-disable-next-line @eslint-react/dom/no-missing-button-type diff --git a/src/components/ui/SearchInput.tsx b/src/components/ui/SearchInput.tsx index 2e70d1b35..d31463010 100644 --- a/src/components/ui/SearchInput.tsx +++ b/src/components/ui/SearchInput.tsx @@ -98,6 +98,7 @@ class SearchInput extends Component { /> {value.length > 0 && ( + // eslint-disable-next-line jsx-a11y/no-static-element-interactions this.reset()} onKeyDown={noop}> diff --git a/src/components/ui/Tabs/Tabs.tsx b/src/components/ui/Tabs/Tabs.tsx index a5ec148aa..d1e397122 100644 --- a/src/components/ui/Tabs/Tabs.tsx +++ b/src/components/ui/Tabs/Tabs.tsx @@ -35,6 +35,7 @@ class Tab extends Component { render(): ReactElement { const { children: childElements } = this.props; + // eslint-disable-next-line @eslint-react/no-children-to-array const children = Children.toArray(childElements); // removes all null values if (children.length === 1) { @@ -44,9 +45,10 @@ class Tab extends Component { return (
+ {/* eslint-disable-next-line @eslint-react/no-children-map */} {Children.map(children, (child, i) => (
+ {/* eslint-disable-next-line @eslint-react/no-children-map */} {Children.map(children, (child, i) => (
{ ) : (