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/features/appearance/index.ts | 1 + src/features/basicAuth/Component.tsx | 2 + src/features/communityRecipes/store.ts | 1 + src/features/quickSwitch/Component.tsx | 2 + src/features/todos/actions.ts | 1 + src/features/todos/components/TodosWebview.tsx | 3 ++ src/features/todos/index.ts | 1 + .../webControls/containers/WebControlsScreen.tsx | 2 + .../workspaces/components/CreateWorkspaceForm.tsx | 2 + .../workspaces/components/EditWorkspaceForm.tsx | 7 ++- .../workspaces/components/WorkspaceDrawer.tsx | 2 + .../workspaces/components/WorkspaceDrawerItem.tsx | 1 + .../components/WorkspaceServiceListItem.tsx | 1 + .../workspaces/components/WorkspacesDashboard.tsx | 50 +++++++++++----------- src/features/workspaces/index.ts | 1 + 15 files changed, 50 insertions(+), 27 deletions(-) (limited to 'src/features') diff --git a/src/features/appearance/index.ts b/src/features/appearance/index.ts index 049080505..9b7715a23 100644 --- a/src/features/appearance/index.ts +++ b/src/features/appearance/index.ts @@ -46,6 +46,7 @@ function generateAccentStyle(accentColorStr) { try { accentColor = color(accentColorStr); } catch { + // eslint-disable-next-line no-param-reassign accentColorStr = DEFAULT_APP_SETTINGS.accentColor; accentColor = color(accentColorStr); } diff --git a/src/features/basicAuth/Component.tsx b/src/features/basicAuth/Component.tsx index 7c901344d..bae38443a 100644 --- a/src/features/basicAuth/Component.tsx +++ b/src/features/basicAuth/Component.tsx @@ -61,6 +61,7 @@ class BasicAuthModal extends Component { @@ -86,6 +87,7 @@ class BasicAuthModal extends Component { type="button" label={intl.formatMessage(globalMessages.cancel)} buttonType="secondary" + // eslint-disable-next-line react/jsx-no-bind onClick={this.cancel.bind(this)} />