From f5ca29e55c9ad2835f87bd8f28b2e112287f862a Mon Sep 17 00:00:00 2001 From: Catalin <20538711+devcatalin@users.noreply.github.com> Date: Mon, 22 Nov 2021 16:05:04 +0200 Subject: [PATCH] fix: prettierrc and loadKubeConfig formatting --- .prettierrc | 2 +- src/redux/thunks/loadKubeConfig.ts | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.prettierrc b/.prettierrc index c204d3655b..dfc4c46fec 100644 --- a/.prettierrc +++ b/.prettierrc @@ -7,7 +7,7 @@ "^@ant-design?.+$", "^@reduxjs?.+$", "^@rjsf?.+$", - "", + "^(?![@\\.]).+$", "^@constants", "^@models", "^@redux", diff --git a/src/redux/thunks/loadKubeConfig.ts b/src/redux/thunks/loadKubeConfig.ts index 1b31355e79..7404b4752f 100644 --- a/src/redux/thunks/loadKubeConfig.ts +++ b/src/redux/thunks/loadKubeConfig.ts @@ -1,8 +1,14 @@ -import {createAsyncThunk} from '@reduxjs/toolkit'; -import {AppDispatch, RootState} from '@redux/store'; import * as k8s from '@kubernetes/client-node'; -import {KubeConfig, KubeConfigContext} from '@models/kubeConfig'; + +import {createAsyncThunk} from '@reduxjs/toolkit'; + import fs from 'fs'; +import log from 'loglevel'; + +import {KubeConfig, KubeConfigContext} from '@models/kubeConfig'; + +import {AppDispatch, RootState} from '@redux/store'; + import {createRejectionWithAlert} from './utils'; export const loadContexts = createAsyncThunk< @@ -22,7 +28,7 @@ export const loadContexts = createAsyncThunk< kc.loadFromFile(configPath); const kubeConfig: KubeConfig = { - contexts: >kc.contexts, + contexts: kc.contexts as KubeConfigContext[], currentContext: kc.currentContext, }; return kubeConfig; @@ -31,8 +37,7 @@ export const loadContexts = createAsyncThunk< } } } catch (e) { - // + log.info(e); } - return thunkAPI.reject(); });