From 8c131073730ec684145c2cc8ee8d6b39bbe9278d Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Sun, 23 Jul 2023 20:08:52 -0600 Subject: chore: improve lint setup - update eslint config - merged eslint rules for JS and TS to avoid duplicates - extended stricter lint ruleset from typescript-eslint - corrected wrong setup for certain eslint rulesets - opt in to reportUnusedDisableDirectives config option - fix or disable a lot of lint issues throughout codebase - remove trailingComma: all from prettier config which is default in prettier v3 - add volta configuration to package.json to autoload correct node and pnpm versions - upgrade all eslint and prettier related dependencies to latest - remove config options from settings.json which are default anyways - remove config options from settings.json which are outdated/unknown - set up prettier as default formatter in settings.json --- src/features/serviceProxy/index.ts | 6 +----- src/features/workspaces/components/WorkspaceDrawer.tsx | 5 +++-- src/features/workspaces/components/WorkspaceDrawerItem.tsx | 1 + src/features/workspaces/components/WorkspacesDashboard.tsx | 1 - src/features/workspaces/store.ts | 1 + 5 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/features') diff --git a/src/features/serviceProxy/index.ts b/src/features/serviceProxy/index.ts index eb3b89ece..c98ae00a7 100644 --- a/src/features/serviceProxy/index.ts +++ b/src/features/serviceProxy/index.ts @@ -33,11 +33,7 @@ export default function init(stores: { if (config.isEnabled) { const serviceProxyConfig = proxySettings[service.id]; - if ( - serviceProxyConfig && - serviceProxyConfig.isEnabled && - serviceProxyConfig.host - ) { + if (serviceProxyConfig?.isEnabled && serviceProxyConfig.host) { const proxyHost = `${serviceProxyConfig.host}${ serviceProxyConfig.port ? `:${serviceProxyConfig.port}` : '' }`; diff --git a/src/features/workspaces/components/WorkspaceDrawer.tsx b/src/features/workspaces/components/WorkspaceDrawer.tsx index 1c827e9dd..3e05cb7de 100644 --- a/src/features/workspaces/components/WorkspaceDrawer.tsx +++ b/src/features/workspaces/components/WorkspaceDrawer.tsx @@ -98,6 +98,7 @@ class WorkspaceDrawer extends Component { try { getUserWorkspacesRequest.execute(); } catch (error) { + // eslint-disable-next-line no-console console.log(error); } } @@ -121,9 +122,9 @@ class WorkspaceDrawer extends Component { workspaceActions.openWorkspaceSettings(); }} data-tooltip-id="tooltip-workspaces-drawer" - data-tooltip-content={`${intl.formatMessage( + data-tooltip-content={intl.formatMessage( messages.workspacesSettingsTooltip, - )}`} + )} > , WrappedComponentProps { name: string; onClick: MouseEventHandler; services: string[]; + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type onContextMenuEditClick?: () => void | null; shortcutIndex: number; } diff --git a/src/features/workspaces/components/WorkspacesDashboard.tsx b/src/features/workspaces/components/WorkspacesDashboard.tsx index c5f8909c1..a823132c5 100644 --- a/src/features/workspaces/components/WorkspacesDashboard.tsx +++ b/src/features/workspaces/components/WorkspacesDashboard.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-no-useless-fragment */ import { Component, ReactElement } from 'react'; import { observer } from 'mobx-react'; import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl'; diff --git a/src/features/workspaces/store.ts b/src/features/workspaces/store.ts index 53e3b62ed..34a4126c8 100644 --- a/src/features/workspaces/store.ts +++ b/src/features/workspaces/store.ts @@ -64,6 +64,7 @@ export default class WorkspacesStore extends FeatureStore { return getUserWorkspacesRequest.wasExecuted && this.workspaces.length > 0; } + // eslint-disable-next-line @typescript-eslint/class-literal-property-style @computed get isUserAllowedToUseFeature() { return true; } -- cgit v1.2.3-54-g00ecf