Add eslint:recommended lint rule (#4577)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-01-07 08:38:21 -05:00
1 parent 4f75acf2b4
commit fa3708c879
27 files changed
+88 -57

No files matched your search

+3 -1
View File
@@ -119,7 +119,9 @@ export class HelmRepoManager extends Singleton {
if (typeof parsedConfig === "object" && parsedConfig) {
return parsedConfig as HelmRepoConfig;
}
} catch { }
} catch {
// ignore error
}
return {
repositories: [],
+3 -1
View File
@@ -97,7 +97,9 @@ export function initIpcMainHandlers(electronMenuItems: IComputedValue<MenuRegist
const localStorageFilePath = path.resolve(AppPaths.get("userData"), "lens-local-storage", `${cluster.id}.json`);
await remove(localStorageFilePath);
} catch {}
} catch {
// ignore error
}
});
ipcMainHandle(clusterSetDeletingHandler, (event, clusterId: string) => {
+11 -11
View File
@@ -357,10 +357,10 @@ export class Kubectl {
bashScript += `export PATH="${helmPath}:${kubectlPath}:$PATH"\n`;
bashScript += "export KUBECONFIG=\"$tempkubeconfig\"\n";
bashScript += `NO_PROXY=\",\${NO_PROXY:-localhost},\"\n`;
bashScript += `NO_PROXY=\"\${NO_PROXY//,localhost,/,}\"\n`;
bashScript += `NO_PROXY=\"\${NO_PROXY//,127.0.0.1,/,}\"\n`;
bashScript += `NO_PROXY=\"localhost,127.0.0.1\${NO_PROXY%,}\"\n`;
bashScript += `NO_PROXY=",\${NO_PROXY:-localhost},"\n`;
bashScript += `NO_PROXY="\${NO_PROXY//,localhost,/,}"\n`;
bashScript += `NO_PROXY="\${NO_PROXY//,127.0.0.1,/,}"\n`;
bashScript += `NO_PROXY="localhost,127.0.0.1\${NO_PROXY%,}"\n`;
bashScript += "export NO_PROXY\n";
bashScript += "unset tempkubeconfig\n";
await fsPromises.writeFile(bashScriptPath, bashScript.toString(), { mode: 0o644 });
@@ -378,18 +378,18 @@ export class Kubectl {
zshScript += "test -f \"$OLD_ZDOTDIR/.zshrc\" && . \"$OLD_ZDOTDIR/.zshrc\"\n";
// voodoo to replace any previous occurrences of kubectl path in the PATH
zshScript += `kubectlpath=\"${kubectlPath}"\n`;
zshScript += `helmpath=\"${helmPath}"\n`;
zshScript += `kubectlpath="${kubectlPath}"\n`;
zshScript += `helmpath="${helmPath}"\n`;
zshScript += "p=\":$kubectlpath:\"\n";
zshScript += "d=\":$PATH:\"\n";
zshScript += `d=\${d//$p/:}\n`;
zshScript += `d=\${d/#:/}\n`;
zshScript += `export PATH=\"$helmpath:$kubectlpath:\${d/%:/}\"\n`;
zshScript += `export PATH="$helmpath:$kubectlpath:\${d/%:/}"\n`;
zshScript += "export KUBECONFIG=\"$tempkubeconfig\"\n";
zshScript += `NO_PROXY=\",\${NO_PROXY:-localhost},\"\n`;
zshScript += `NO_PROXY=\"\${NO_PROXY//,localhost,/,}\"\n`;
zshScript += `NO_PROXY=\"\${NO_PROXY//,127.0.0.1,/,}\"\n`;
zshScript += `NO_PROXY=\"localhost,127.0.0.1\${NO_PROXY%,}\"\n`;
zshScript += `NO_PROXY=",\${NO_PROXY:-localhost},"\n`;
zshScript += `NO_PROXY="\${NO_PROXY//,localhost,/,}"\n`;
zshScript += `NO_PROXY="\${NO_PROXY//,127.0.0.1,/,}"\n`;
zshScript += `NO_PROXY="localhost,127.0.0.1\${NO_PROXY%,}"\n`;
zshScript += "export NO_PROXY\n";
zshScript += "unset tempkubeconfig\n";
zshScript += "unset OLD_ZDOTDIR\n";
@@ -72,6 +72,7 @@ export class NodeShellSession extends ShellSession {
switch (nodeOs) {
default:
logger.warn(`[NODE-SHELL-SESSION]: could not determine node OS, falling back with assumption of linux`);
// fallthrough
case "linux":
args.push("sh", "-c", "((clear && bash) || (clear && ash) || (clear && sh))");
break;
+6 -2
View File
@@ -134,7 +134,9 @@ export abstract class ShellSession {
for (const shellProcess of this.processes.values()) {
try {
process.kill(shellProcess.pid);
} catch {}
} catch {
// ignore error
}
}
this.processes.clear();
@@ -214,7 +216,9 @@ export abstract class ShellSession {
if (stats.isDirectory()) {
return potentialCwd;
}
} catch {}
} catch {
// ignore error
}
}
return "."; // Always valid