From d89829d03f1e71f962d1d34d0cf9edccc9254100 Mon Sep 17 00:00:00 2001 From: "Recuenco, David" Date: Thu, 1 Dec 2022 15:12:13 +0100 Subject: [PATCH] FIX linter issues, missing imports --- .eslintrc | 25 +++++++++++++++++++++++-- src/background/handlers/config.js | 1 + src/background/handlers/resources.js | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index ba1b5e3..d5877cc 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,6 +5,27 @@ "sourceType": "module" }, "rules": { - "semi": [ "error", "always" ] - } + "semi": [ "error", "always" ], + "no-undef": "error", + "no-unused-vars": "error" + }, + "overrides": [ + { + "files": [ "src/foreground/**/*" ], + "env": { + "browser": true + }, + "globals": { + "api": false + } + }, + { + "files": [ "src/background/**/*", "*.config.js" ], + "env": { + "es6": true, + "node": true, + "commonjs": true + } + } + ] } diff --git a/src/background/handlers/config.js b/src/background/handlers/config.js index 8d8ae74..809439d 100644 --- a/src/background/handlers/config.js +++ b/src/background/handlers/config.js @@ -1,6 +1,7 @@ const { resolve } = require('path'); const { readdir } = require('fs/promises'); const { KubeConfig } = require("@kubernetes/client-node"); +const { kubeDir } = require('../constants'); /** * @param {import('electron').IpcMain} ipc bus diff --git a/src/background/handlers/resources.js b/src/background/handlers/resources.js index 83c17ec..34c32e1 100644 --- a/src/background/handlers/resources.js +++ b/src/background/handlers/resources.js @@ -1,4 +1,5 @@ const { getContextForName, loadKubeConfig, apiForResourceType, methodForResourceType, getLogEmitter, stopLogEmitter } = require('../services/kubernetes'); +const { logger } = require('../logger'); /** * @param {import('electron').IpcMain} ipc bus