Skip to content

Commit

Permalink
Bump eslint to 8.39.0
Browse files Browse the repository at this point in the history
Remove comments on camel case
Update TODO comment

Signed-off-by: Phillip Rak <[email protected]>
  • Loading branch information
rak-phillip committed Sep 28, 2023
1 parent 5a88696 commit b02efc2
Show file tree
Hide file tree
Showing 189 changed files with 1,380 additions and 866 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ Object.assign(module.exports.rules, {
'import/first': 'error',
'valid-typeof': 'error',
'@typescript-eslint/no-namespace': 'error',

// destructuring: don't error if `a` is reassigned, but `b` is never reassigned
'prefer-const': ['error', { destructuring: 'all' }],
});
module.exports.rules['key-spacing'][1].align.mode = 'strict';

Expand Down
7 changes: 4 additions & 3 deletions background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import os from 'os';
import path from 'path';
import util from 'util';

import Electron from 'electron';
import _ from 'lodash';
import semver from 'semver';

import BackendHelper from '@pkg/backend/backendHelper';
import K8sFactory from '@pkg/backend/factory';
import { getImageProcessor } from '@pkg/backend/images/imageFactory';
Expand Down Expand Up @@ -47,9 +51,6 @@ import { getVersion } from '@pkg/utils/version';
import * as window from '@pkg/window';
import { closeDashboard, openDashboard } from '@pkg/window/dashboard';
import { openPreferences, preferencesSetDirtyFlag } from '@pkg/window/preferences';
import Electron from 'electron';
import _ from 'lodash';
import semver from 'semver';

Electron.app.setPath('cache', paths.cache);
Electron.app.setAppLogsPath(paths.logs);
Expand Down
9 changes: 5 additions & 4 deletions e2e/backend.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import fs from 'fs';
import os from 'os';
import path from 'path';

import { Settings, ContainerEngine } from '@pkg/config/settings';
import fetch from '@pkg/utils/fetch';
import paths from '@pkg/utils/paths';
import { RecursivePartial, RecursiveKeys } from '@pkg/utils/typeUtils';
import { test, expect, _electron } from '@playwright/test';
import _ from 'lodash';
import semver from 'semver';

import { NavPage } from './pages/nav-page';
import { createDefaultSettings, getAlternateSetting, startRancherDesktop, teardown } from './utils/TestUtils';

import { Settings, ContainerEngine } from '@pkg/config/settings';
import fetch from '@pkg/utils/fetch';
import paths from '@pkg/utils/paths';
import { RecursivePartial, RecursiveKeys } from '@pkg/utils/typeUtils';

import type { ElectronApplication, Page } from '@playwright/test';

test.describe.serial('KubernetesBackend', () => {
Expand Down
7 changes: 4 additions & 3 deletions e2e/credentials-server.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ import process from 'process';
import stream from 'stream';

import { findHomeDir } from '@kubernetes/client-node';
import { ServerState } from '@pkg/main/commandServer/httpCommandServer';
import { spawnFile } from '@pkg/utils/childProcess';
import paths from '@pkg/utils/paths';
import { expect, test, _electron } from '@playwright/test';
import fetch from 'node-fetch';

Expand All @@ -38,6 +35,10 @@ import {
createDefaultSettings, getFullPathForTool, retry, startRancherDesktop, teardown, tool,
} from './utils/TestUtils';

import { ServerState } from '@pkg/main/commandServer/httpCommandServer';
import { spawnFile } from '@pkg/utils/childProcess';
import paths from '@pkg/utils/paths';

import type { ElectronApplication, Page } from '@playwright/test';

let credStore = '';
Expand Down
7 changes: 4 additions & 3 deletions e2e/extensions.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import os from 'os';
import path from 'path';

import { ContainerEngine, Settings } from '@pkg/config/settings';
import { spawnFile } from '@pkg/utils/childProcess';
import { Log } from '@pkg/utils/logging';
import {
ElectronApplication, Page, test, expect, JSHandle, TestInfo,
} from '@playwright/test';
Expand All @@ -18,6 +15,10 @@ import {
createDefaultSettings, getFullPathForTool, getResourceBinDir, reportAsset, retry, startRancherDesktop, teardown,
} from './utils/TestUtils';

import { ContainerEngine, Settings } from '@pkg/config/settings';
import { spawnFile } from '@pkg/utils/childProcess';
import { Log } from '@pkg/utils/logging';

import type { BrowserView, BrowserWindow } from 'electron';

/** The top level source directory, assuming we're always running from the tree */
Expand Down
6 changes: 3 additions & 3 deletions e2e/lockedFields.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ limitations under the License.
import os from 'os';
import path from 'path';

import { readDeploymentProfiles } from '@pkg/main/deploymentProfiles';
import { spawnFile } from '@pkg/utils/childProcess';
import { reopenLogs } from '@pkg/utils/logging';
import { expect, test } from '@playwright/test';

import { NavPage } from './pages/nav-page';
Expand All @@ -34,6 +31,9 @@ import {
} from './utils/TestUtils';

import type { DeploymentProfileType } from '@pkg/config/settings';
import { readDeploymentProfiles } from '@pkg/main/deploymentProfiles';
import { spawnFile } from '@pkg/utils/childProcess';
import { reopenLogs } from '@pkg/utils/logging';

import type { ElectronApplication, Page } from '@playwright/test';

Expand Down
3 changes: 2 additions & 1 deletion e2e/preferences.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os from 'os';

import { reopenLogs } from '@pkg/utils/logging';
import { test, expect, _electron } from '@playwright/test';

import { NavPage } from './pages/nav-page';
import { PreferencesPage } from './pages/preferences';
import { createDefaultSettings, startRancherDesktop, teardown, tool } from './utils/TestUtils';

import { reopenLogs } from '@pkg/utils/logging';

import type { ElectronApplication, Page } from '@playwright/test';

let page: Page;
Expand Down
19 changes: 10 additions & 9 deletions e2e/rdctl.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ import fs from 'fs';
import os from 'os';
import path from 'path';

import { expect, test } from '@playwright/test';
import _ from 'lodash';
import fetch, { RequestInit } from 'node-fetch';
import yaml from 'yaml';

import { NavPage } from './pages/nav-page';
import {
createDefaultSettings, getAlternateSetting, kubectl, retry, startRancherDesktop, teardown, waitForRestartVM,
} from './utils/TestUtils';

import {
ContainerEngine,
Settings,
Expand All @@ -38,15 +48,6 @@ import { ServerState } from '@pkg/main/commandServer/httpCommandServer';
import { spawnFile } from '@pkg/utils/childProcess';
import paths from '@pkg/utils/paths';
import { RecursivePartial } from '@pkg/utils/typeUtils';
import { expect, test } from '@playwright/test';
import _ from 'lodash';
import fetch, { RequestInit } from 'node-fetch';
import yaml from 'yaml';

import { NavPage } from './pages/nav-page';
import {
createDefaultSettings, getAlternateSetting, kubectl, retry, startRancherDesktop, teardown, waitForRestartVM,
} from './utils/TestUtils';

import type { ElectronApplication, Page } from '@playwright/test';

Expand Down
9 changes: 5 additions & 4 deletions e2e/startup-profiles.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ limitations under the License.
import fs from 'fs';
import path from 'path';

import { Settings } from '@pkg/config/settings';
import * as childProcess from '@pkg/utils/childProcess';
import paths from '@pkg/utils/paths';
import { RecursivePartial } from '@pkg/utils/typeUtils';
import { expect, test } from '@playwright/test';

import {
Expand All @@ -36,6 +32,11 @@ import {
} from './utils/ProfileUtils';
import { createUserProfile, reportAsset } from './utils/TestUtils';

import { Settings } from '@pkg/config/settings';
import * as childProcess from '@pkg/utils/childProcess';
import paths from '@pkg/utils/paths';
import { RecursivePartial } from '@pkg/utils/typeUtils';

async function createInvalidDarwinUserProfile(contents: string) {
const userProfilePath = path.join(paths.deploymentProfileUser, 'io.rancherdesktop.profile.defaults.plist');

Expand Down
5 changes: 3 additions & 2 deletions e2e/utils/ProfileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import os from 'os';
import path from 'path';
import util from 'util';

import * as childProcess from '@pkg/utils/childProcess';
import paths from '@pkg/utils/paths';
import { expect, Page } from '@playwright/test';

import {
createDefaultSettings, createUserProfile, startRancherDesktop, retry, teardown,
} from './TestUtils';
import { NavPage } from '../pages/nav-page';

import * as childProcess from '@pkg/utils/childProcess';
import paths from '@pkg/utils/paths';

export async function clearSettings(): Promise<void> {
const fullPath = path.join(paths.config, 'settings.json');

Expand Down
7 changes: 4 additions & 3 deletions e2e/utils/TestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import os from 'os';
import path from 'path';
import util from 'util';

import { expect, _electron, ElectronApplication, Locator } from '@playwright/test';
import _, { GetFieldType } from 'lodash';
import plist from 'plist';

import { defaultSettings, LockedSettingsType, Settings } from '@pkg/config/settings';
import { PathManagementStrategy } from '@pkg/integrations/pathManager';
import * as childProcess from '@pkg/utils/childProcess';
import paths from '@pkg/utils/paths';
import { RecursivePartial, RecursiveTypes } from '@pkg/utils/typeUtils';
import { expect, _electron, ElectronApplication, Locator } from '@playwright/test';
import _, { GetFieldType } from 'lodash';
import plist from 'plist';

let testInfo: undefined | {
testPath: string;
Expand Down
3 changes: 2 additions & 1 deletion e2e/wsl-integrations.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import fs from 'fs';
import os from 'os';
import path from 'path';

import { spawnFile } from '@pkg/utils/childProcess';
import { expect, test } from '@playwright/test';

import { NavPage } from './pages/nav-page';
import { PreferencesPage } from './pages/preferences';
import { createDefaultSettings, retry, startRancherDesktop, teardown } from './utils/TestUtils';

import { spawnFile } from '@pkg/utils/childProcess';

import type { ElectronApplication, Page } from '@playwright/test';

test.describe('WSL Integrations', () => {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
"@electron/asar": "3.2.3",
"@nuxt/types": "2.15.8",
"@nuxtjs/eslint-config": "6.0.1",
"@nuxtjs/eslint-config-typescript": "6.0.1",
"@nuxtjs/eslint-config-typescript": "8.0.0",
"@nuxtjs/router-extras": "1.1.1",
"@nuxtjs/style-resources": "1.2.1",
"@octokit/rest": "19.0.5",
Expand Down Expand Up @@ -159,7 +158,7 @@
"electron": "20.3.8",
"electron-builder": "23.6.0",
"electron-notarize": "1.2.2",
"eslint": "7.32.0",
"eslint": "8.39.0",
"eslint-import-resolver-typescript": "3.5.5",
"eslint-plugin-deprecation": "1.3.3",
"eslint-plugin-import": "2.27.5",
Expand Down
3 changes: 2 additions & 1 deletion pkg/rancher-desktop/backend/__tests__/k3sHelper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import os from 'os';
import path from 'path';
import util from 'util';

import paths from '@pkg/utils/paths';
import fetch from 'node-fetch';
import semver from 'semver';

import K3sHelper, {
buildVersion, ChannelMapping, NoCachedK3sVersionsError, ReleaseAPIEntry, VersionEntry,
} from '../k3sHelper';

import paths from '@pkg/utils/paths';

const cachePath = path.join(paths.cache, 'k3s-versions.json');
const { Response: FetchResponse } = jest.requireActual('node-fetch');

Expand Down
7 changes: 4 additions & 3 deletions pkg/rancher-desktop/backend/backendHelper.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@

import Electron from 'electron';
import merge from 'lodash/merge';
import semver from 'semver';

import { BackendSettings } from '@pkg/backend/backend';
import { LockedFieldError } from '@pkg/config/commandLineOptions';
import { ContainerEngine, Settings } from '@pkg/config/settings';
import * as settingsImpl from '@pkg/config/settingsImpl';
import SettingsValidator from '@pkg/main/commandServer/settingsValidator';
import Logging from '@pkg/utils/logging';
import { showMessageBox } from '@pkg/window';
import Electron from 'electron';
import merge from 'lodash/merge';
import semver from 'semver';

const console = Logging.kube;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

import { FetchError } from 'node-fetch';

import dockerRegistry, { getAsList } from '@pkg/backend/containerClient/registry';
import { Headers } from '@pkg/utils/fetch';
import { FetchError } from 'node-fetch';

describe('Headers', () => {
test('getAsList', () => {
Expand Down
15 changes: 8 additions & 7 deletions pkg/rancher-desktop/backend/containerClient/mobyClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ import os from 'os';
import path from 'path';
import util from 'util';

import { VMExecutor } from '@pkg/backend/backend';
import dockerRegistry from '@pkg/backend/containerClient/registry';
import { ErrorCommand, spawn, spawnFile } from '@pkg/utils/childProcess';
import { parseImageReference } from '@pkg/utils/dockerUtils';
import Logging, { Log } from '@pkg/utils/logging';
import paths from '@pkg/utils/paths';
import { executable } from '@pkg/utils/resources';
import _ from 'lodash';

import {
Expand All @@ -18,6 +11,14 @@ import {
ContainerRunClientOptions, ContainerComposePortOptions, ContainerBasicOptions,
} from './types';

import { VMExecutor } from '@pkg/backend/backend';
import dockerRegistry from '@pkg/backend/containerClient/registry';
import { ErrorCommand, spawn, spawnFile } from '@pkg/utils/childProcess';
import { parseImageReference } from '@pkg/utils/dockerUtils';
import Logging, { Log } from '@pkg/utils/logging';
import paths from '@pkg/utils/paths';
import { executable } from '@pkg/utils/resources';

const console = Logging.moby;

type runClientOptions = ContainerRunClientOptions & {
Expand Down
15 changes: 8 additions & 7 deletions pkg/rancher-desktop/backend/containerClient/nerdctlClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ import path from 'path';
import stream from 'stream';
import util from 'util';

import { execOptions, VMExecutor } from '@pkg/backend/backend';
import dockerRegistry from '@pkg/backend/containerClient/registry';
import { spawn, spawnFile } from '@pkg/utils/childProcess';
import { parseImageReference } from '@pkg/utils/dockerUtils';
import Logging, { Log } from '@pkg/utils/logging';
import { executable } from '@pkg/utils/resources';
import { defined } from '@pkg/utils/typeUtils';
import _ from 'lodash';
import tar from 'tar-stream';

Expand All @@ -20,6 +13,14 @@ import {
ContainerRunClientOptions, ContainerComposePortOptions, ContainerBasicOptions,
} from './types';

import { execOptions, VMExecutor } from '@pkg/backend/backend';
import dockerRegistry from '@pkg/backend/containerClient/registry';
import { spawn, spawnFile } from '@pkg/utils/childProcess';
import { parseImageReference } from '@pkg/utils/dockerUtils';
import Logging, { Log } from '@pkg/utils/logging';
import { executable } from '@pkg/utils/resources';
import { defined } from '@pkg/utils/typeUtils';

const console = Logging.nerdctl;

/**
Expand Down
4 changes: 2 additions & 2 deletions pkg/rancher-desktop/backend/factory.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os from 'os';

import DockerDirManager from '@pkg/utils/dockerDirManager';

import { Architecture, VMBackend } from './backend';
import LimaKubernetesBackend from './kube/lima';
import WSLKubernetesBackend from './kube/wsl';
import LimaBackend from './lima';
import MockBackend from './mock';
import WSLBackend from './wsl';

import DockerDirManager from '@pkg/utils/dockerDirManager';

export default function factory(arch: Architecture, dockerDirManager: DockerDirManager): VMBackend {
const platform = os.platform();

Expand Down
Loading

0 comments on commit b02efc2

Please sign in to comment.