chore: Turn on @typescript-eslint/strict-boolean-expressions

- Fix some bugs about bad conditions

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-06-01 09:27:44 -04:00
1 parent d3f45bfe49
commit 1675c56e59
165 files changed
+853 -1141

No files matched your search

@@ -65,6 +65,10 @@ export function parseKubeApi(path: string | undefined): IKubeApiParsed | undefin
const { apiOrApis, apiGroup, namespace, apiVersion, resource, name } = parsedPath;
if (!apiOrApis || !apiGroup || !apiVersion || !resource) {
return undefined;
}
return {
apiBase: getApiBase(apiOrApis, apiGroup, apiVersion, resource),
apiPrefix: getApiPrefix(apiOrApis),
@@ -487,11 +487,11 @@ export class KubeApi<
}
protected normalizeQuery(query: Partial<KubeApiQueryParams> = {}) {
if (query.labelSelector) {
if (query.labelSelector !== undefined) {
query.labelSelector = [query.labelSelector].flat().join(",");
}
if (query.fieldSelector) {
if (query.fieldSelector !== undefined) {
query.fieldSelector = [query.fieldSelector].flat().join(",");
}
@@ -499,7 +499,7 @@ export class KubeApi<
}
protected parseResponse(data: unknown, namespace?: string): Kube | Kube[] | null {
if (!data) {
if (!Boolean(data)) {
return null;
}