Skip to content

Commit 7b9bf6a

Browse files
committed
fix: linter issues
Signed-off-by: Árpád Csepi <csepi.arpad@outlook.com>
1 parent 66cfdfd commit 7b9bf6a

9 files changed

Lines changed: 17 additions & 11 deletions

File tree

examples/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@microsoft/api-extractor": "^7.58.7",
5858
"@rollup/plugin-json": "^6.1.0",
5959
"@rollup/plugin-node-resolve": "^16.0.1",
60-
"@types/node": "^24.0.0",
60+
"@types/node": "^24.13.2",
6161
"@types/uuid": "^11.0.0",
6262
"@vitest/coverage-v8": "^4.1.9",
6363
"eslint": "^10.0.0",

src/client/auth/oauthPkce.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export async function runLoopbackPkceLogin(
253253
if (parsed.hostname !== 'localhost' && parsed.hostname !== '127.0.0.1') {
254254
throw new Error('loopback PKCE requires redirect host localhost or 127.0.0.1');
255255
}
256-
let path = parsed.pathname || '/';
256+
let path = parsed.pathname ?? '/';
257257
if (!path.startsWith('/')) {
258258
path = `/${path}`;
259259
}

src/client/dirctl/verification.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ function runVerifyCommand(config: Config, args: string[]): void {
2121
});
2222

2323
if (output.status !== 0) {
24-
throw new Error(output.stderr || output.stdout || 'Verification failed');
24+
const message =
25+
[output.stderr, output.stdout].map((s) => s.trim()).find((s) => s.length > 0) ??
26+
'Verification failed';
27+
throw new Error(message);
2528
}
2629
}
2730

@@ -141,7 +144,7 @@ export function verifyRecord(
141144

142145
return fromJsonString(models.sign_v1.VerifyResponseSchema, jsonContent);
143146
} catch (e) {
144-
throw new Error(`Failed to parse verification response: ${e}`);
147+
throw new Error(`Failed to parse verification response: ${e}`, { cause: e });
145148
} finally {
146149
try {
147150
rmSync(tempDir, { recursive: true, force: true });

src/client/services/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ export async function invoke<T>(opName: string, call: () => Promise<T>): Promise
2020
return await call();
2121
} catch (e) {
2222
const msg = e instanceof Error ? e.message : String(e);
23-
throw new Error(`${opName} failed: ${msg}`);
23+
throw new Error(`${opName} failed: ${msg}`, { cause: e });
2424
}
2525
}

src/client/transport/channels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function createOidcTransport(config: Config, holder: OAuthTokenHolder): T
4141
try {
4242
ca = readFileSync(config.tlsCaFile).toString();
4343
} catch (e) {
44-
throw new Error(`Failed to read TLS CA file: ${(e as Error).message}`);
44+
throw new Error(`Failed to read TLS CA file: ${(e as Error).message}`, { cause: e });
4545
}
4646
}
4747
const nodeBase: http2.SecureClientSessionOptions = {};

test/client.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { fileURLToPath } from 'node:url';
1010
import { pool as workerpool } from 'workerpool';
1111
import { rmSync, realpathSync } from 'node:fs';
1212
import { env } from 'node:process';
13-
import { create, fromJson } from '@bufbuild/protobuf';
13+
import { create, fromJson, type JsonValue } from '@bufbuild/protobuf';
1414

1515
import { validate as isValidUUID } from 'uuid';
1616
import { v4 as uuidv4 } from 'uuid';
@@ -71,7 +71,7 @@ const testDir = dirname(fileURLToPath(import.meta.url));
7171

7272
function loadCatalogFixtureRecord(): models.core_v1.Record {
7373
const fixturePath = join(testDir, 'testdata', 'record_100.json');
74-
const recordData = JSON.parse(readFileSync(fixturePath, 'utf8')) as Record<string, unknown>;
74+
const recordData = JSON.parse(readFileSync(fixturePath, 'utf8')) as JsonValue;
7575
return fromJson(models.core_v1.RecordSchema, { data: recordData });
7676
}
7777

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
// DOM for the fetch and streams API
1212
"DOM",
1313
// ES2018.AsyncIterable for AsyncIterator
14-
"ES2018.AsyncIterable"
14+
"ES2018.AsyncIterable",
15+
// Error constructor options (cause)
16+
"ES2022.Error"
1517
],
18+
"types": ["node"],
1619
"declaration": true,
1720
"strict": true,
1821
"resolveJsonModule": true,

0 commit comments

Comments
 (0)