Skip to content

Commit 680ac1e

Browse files
authored
Merge pull request #9906 from rancher-sandbox/dependabot/npm_and_yarn/eslint/js-10.0.1
build(deps-dev): bump @eslint/js from 9.39.2 to 10.0.1
2 parents 42a1826 + 9a78edc commit 680ac1e

File tree

17 files changed

+58
-39
lines changed

17 files changed

+58
-39
lines changed

background.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ function updateBackendLockState(backendIsLocked: string, action?: string): void
368368
* status.
369369
*/
370370
async function doesBackendLockExist(): Promise<boolean> {
371-
let backendIsLocked = '';
371+
let backendIsLocked: string;
372372

373373
const lockFileContents = await readBackendLockFile();
374374

e2e/backend.e2e.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ test.describe.serial('KubernetesBackend', () => {
8686

8787
try {
8888
return JSON.parse(text);
89-
} catch (ex) {
90-
throw new Error(`Response text is not JSON: \n${ text }`);
89+
} catch (cause) {
90+
throw new Error(`Response text is not JSON: \n${ text }`, { cause });
9191
}
9292
}
9393

e2e/utils/ProfileUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ export async function verifyNoRegistrySubtree(hive: string): Promise<void> {
124124
}
125125
try {
126126
await childProcess.spawnFile('reg', ['delete', registryPath, '/f'], { stdio: ['ignore', 'pipe', 'pipe'] });
127-
} catch (ex: any) {
128-
throw new Error(`Need to remove registry hive "${ registryPath }" (tried, got error ${ ex }`);
127+
} catch (cause: any) {
128+
throw new Error(`Need to remove registry hive "${ registryPath }" (tried, got error ${ cause })`, { cause });
129129
}
130130
}
131131
}

e2e/utils/TestUtils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ async function setWindowsUserLegacyProfile(userProfile: RecursivePartial<Setting
7272
const keyPath = `HKCU\\SOFTWARE\\Rancher Desktop\\Profile\\${ registryType }`;
7373

7474
await childProcess.spawnFile('reg.exe', ['DELETE', keyPath, '/f'], { stdio: 'pipe' });
75-
} catch (ex: any) {
76-
if (!/unable to find/.test(Object(ex).stderr ?? '')) {
77-
throw new Error(`Error trying to delete a user registry hive: ${ ex }`);
75+
} catch (cause: any) {
76+
if (!/unable to find/.test(Object(cause).stderr ?? '')) {
77+
throw new Error(`Error trying to delete a user registry hive: ${ cause }`, { cause });
7878
}
7979
}
8080

@@ -86,8 +86,8 @@ async function setWindowsUserLegacyProfile(userProfile: RecursivePartial<Setting
8686
try {
8787
await fs.promises.writeFile(regFile, genResult);
8888
await childProcess.spawnFile('reg.exe', ['IMPORT', regFile], { stdio: 'ignore' });
89-
} catch (ex: any) {
90-
throw new Error(`Error trying to create a user registry hive: ${ ex }`);
89+
} catch (cause: any) {
90+
throw new Error(`Error trying to create a user registry hive: ${ cause }`, { cause });
9191
}
9292
}
9393
}
@@ -208,7 +208,7 @@ export async function teardownApp(app: ElectronApplication) {
208208
// Send SIGTERM to the process group, wait three seconds, then send
209209
// SIGKILL and wait for one more second.
210210
for (const [signal, timeout] of [['TERM', 3_000], ['KILL', 1_000]] as const) {
211-
let pids: string[] = [];
211+
let pids: string[];
212212

213213
try {
214214
const args = ['-o', 'pid=', process.platform === 'darwin' ? '-g' : '--sid', `${ pid }`];

eslint.config.mts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ export default defineConfigWithVueTs(
8989
sourceType: 'module',
9090
},
9191
},
92+
{
93+
// The `no-useless-assignment` rule is catching `export const getters = ...` for some reason.
94+
name: 'rancher-desktop-useless-assignment-in-store',
95+
files: ['pkg/rancher-desktop/store/*.ts'],
96+
rules: { 'no-useless-assignment': 'off' },
97+
},
9298
{
9399
// Disable TypeScript-specific rules in JavaScript files.
94100
name: 'rancher-desktop-js',
@@ -120,6 +126,18 @@ export default defineConfigWithVueTs(
120126
globals: globals.browser,
121127
},
122128
},
129+
{
130+
// Files we imported from Rancher Dashboard.
131+
name: 'rancher-dashboard-useless-assignments',
132+
files: [
133+
'pkg/rancher-desktop/components/SortableTable/*',
134+
'pkg/rancher-desktop/store/*.js',
135+
'pkg/rancher-desktop/utils/*.js',
136+
],
137+
rules: {
138+
'no-useless-assignment': 'off',
139+
},
140+
},
123141
{
124142
// Compatibility: disable lints during the ESLint transition.
125143
name: 'rancher-desktop-compatibility',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"@electron/fuses": "^2.0.0",
103103
"@electron/notarize": "3.1.1",
104104
"@eslint/compat": "2.0.2",
105-
"@eslint/js": "9.39.2",
105+
"@eslint/js": "10.0.1",
106106
"@playwright/test": "1.58.2",
107107
"@types/cross-spawn": "6.0.6",
108108
"@types/dompurify": "3.2.0",

pkg/rancher-desktop/backend/containerClient/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class RegistryAuth {
6161
}
6262
}
6363

64-
let knownAuths: Record<string, { Username: string, Secret: string }> = {};
64+
let knownAuths: Record<string, { Username: string, Secret: string }>;
6565

6666
try {
6767
knownAuths = JSON.parse(await runCredentialCommand('list'));

pkg/rancher-desktop/config/commandLineOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ export function updateFromCommandLine(cfg: Settings, lockedFields: LockedSetting
108108
if (['boolean', 'number'].includes(currentValueType)) {
109109
try {
110110
finalValue = JSON.parse(finalValue);
111-
} catch (err) {
112-
throw new Error(`Can't evaluate --${ fqFieldName }=${ finalValue } as ${ currentValueType }: ${ err }`);
111+
} catch (cause) {
112+
throw new Error(`Can't evaluate --${ fqFieldName }=${ finalValue } as ${ currentValueType }: ${ cause }`, { cause });
113113
}
114114
// We know the current value's type is either boolean or number, so a constrained comparison is ok
115115
// eslint-disable-next-line valid-typeof

pkg/rancher-desktop/integrations/unixIntegrationManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export default class UnixIntegrationManager implements IntegrationManager {
213213
// a) is a symlink
214214
// b) has a target path of srcPath
215215
export async function ensureSymlink(srcPath: string, dstPath: string): Promise<void> {
216-
let linkedTo = '';
216+
let linkedTo: string;
217217

218218
try {
219219
linkedTo = await fs.promises.readlink(dstPath);

pkg/rancher-desktop/integrations/windowsIntegrationManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,15 +530,15 @@ export default class WindowsIntegrationManager implements IntegrationManager {
530530
const wslHelper = await this.getLinuxToolPath(distro, executable('wsl-helper-linux'));
531531

532532
await this.execCommand({ distro }, wslHelper, 'kubeconfig', '--verify');
533-
} catch (err: any) {
533+
} catch (cause: any) {
534534
// Only throw for a specific error code 1, since we control that from the
535535
// kubeconfig --verify command. The logic here is to bubble up this error
536536
// so that the diagnostic is very specific to this issue. Any other errors
537537
// are captured as log messages.
538-
if (err && 'code' in err && err.code === 1) {
539-
throw new Error(`The kubeConfig contains non-Rancher Desktop configuration in distro ${ distro }`);
538+
if (cause && 'code' in cause && cause.code === 1) {
539+
throw new Error(`The kubeConfig contains non-Rancher Desktop configuration in distro ${ distro }`, { cause });
540540
} else {
541-
console.error(`Verifying kubeconfig in distro ${ distro } failed: ${ err }`);
541+
console.error(`Verifying kubeconfig in distro ${ distro } failed: ${ cause }`);
542542
}
543543
}
544544
console.debug(`Verified kubeconfig in the following distro: ${ distro }`);

0 commit comments

Comments
 (0)