Skip to content

Commit dc4674f

Browse files
committed
refactor: fix lint
1 parent 5b88a9e commit dc4674f

8 files changed

Lines changed: 18 additions & 20 deletions

File tree

packages/utils/mocks/omit-trace-json.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as fs from 'node:fs/promises';
22
import path from 'node:path';
33
import {
4-
createTraceFile,
54
decodeEvent,
65
encodeEvent,
76
frameName,

packages/utils/src/lib/errors.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('extendError', () => {
119119
const original = new Error('boom');
120120

121121
const extended = extendError(original, 'wrap failed', {
122-
appendMessage: true,
122+
appendOriginalMessage: true,
123123
});
124124

125125
expect(extended.message).toBe('wrap failed\nboom');

packages/utils/src/lib/profiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getNodeJSProfiler } from './profiler/profiler-node';
1+
import { getNodeJSProfiler } from './profiler/profiler-node.js';
22

33
export const profiler = getNodeJSProfiler({
44
track: 'CLI',

packages/utils/src/lib/profiler/profiler-node.int.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ describe('NodeJS Profiler Integration', () => {
2929

3030
// Clean up trace files from previous test runs
3131
const traceFilesDir = path.join(process.cwd(), 'tmp', 'int', 'utils');
32-
// eslint-disable-next-line n/no-sync
32+
3333
if (fs.existsSync(traceFilesDir)) {
34-
// eslint-disable-next-line n/no-sync
3534
const files = fs.readdirSync(traceFilesDir);
3635
// eslint-disable-next-line functional/no-loop-statements
3736
for (const file of files) {
3837
if (file.endsWith('.json') || file.endsWith('.jsonl')) {
39-
// eslint-disable-next-line n/no-sync
4038
fs.unlinkSync(path.join(traceFilesDir, file));
4139
}
4240
}
@@ -266,7 +264,7 @@ describe('NodeJS Profiler Integration', () => {
266264
expect(fileName).toMatch(/^trace\.\d{8}-\d{6}-\d{3}(?:\.\d+){3}\.jsonl$/);
267265

268266
const groupIdDirPath = path.dirname(filePath);
269-
// eslint-disable-next-line n/no-sync
267+
270268
expect(fs.existsSync(groupIdDirPath)).toBeTrue();
271269

272270
profiler.close();
@@ -288,9 +286,9 @@ describe('NodeJS Profiler Integration', () => {
288286
const groupId = path.basename(dirPath);
289287

290288
expect(groupId).toMatch(ID_PATTERNS.TIME_ID);
291-
// eslint-disable-next-line n/no-sync
289+
292290
expect(fs.existsSync(dirPath)).toBeTrue();
293-
// eslint-disable-next-line n/no-sync
291+
294292
expect(fs.statSync(dirPath).isDirectory()).toBeTrue();
295293

296294
profiler.close();

packages/utils/src/lib/profiler/profiler-node.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import {
2525
SHARDED_WAL_COORDINATOR_ID_ENV_VAR,
2626
} from './constants.js';
2727
import { Profiler, type ProfilerOptions } from './profiler.js';
28-
import { entryToTraceEvents } from './trace-file-utils';
29-
import type { TraceEvent } from './trace-file.type';
30-
import { getTraceEventWalFormat } from './wal-json-trace';
28+
import { entryToTraceEvents } from './trace-file-utils.js';
29+
import type { TraceEvent } from './trace-file.type.js';
30+
import { getTraceEventWalFormat } from './wal-json-trace.js';
3131

3232
/**
3333
* Strips encodePerfEntry from a profiler format option and returns the WalFormat part.
@@ -140,8 +140,6 @@ export class NodejsProfiler<
140140
* A WriteAheadLogFile sink is automatically created for buffering performance data.
141141
* @param options - Configuration options
142142
*/
143-
constructor(options: NodejsProfilerOptionsDefault<Tracks>);
144-
constructor(options: NodejsProfilerOptionsWithFormat<DomainEvents, Tracks>);
145143
// eslint-disable-next-line max-lines-per-function
146144
constructor(
147145
options:

packages/utils/src/lib/profiler/trace-file-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
} from 'node:perf_hooks';
77
import { threadId } from 'node:worker_threads';
88
import { defaultClock } from '../clock-epoch.js';
9-
import type { WalRecord } from '../wal';
9+
import type { WalRecord } from '../wal.js';
1010
import type {
1111
TraceEvent,
1212
TraceEventContainer,

packages/utils/src/lib/profiler/wal-json-trace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defaultClock } from '../clock-epoch.js';
2-
import type { Codec, InvalidEntry, WalFormat, WalRecord } from '../wal.js';
2+
import type { Codec, WalFormat, WalRecord } from '../wal.js';
33
import { PROFILER_PERSIST_BASENAME } from './constants.js';
44
import {
55
complete,

packages/utils/src/lib/wal-sharded.unit.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,29 @@ import {
1010
type WalFormat,
1111
type WalRecord,
1212
WriteAheadLogFile,
13-
parseWalFormat,
1413
stringCodec,
1514
} from './wal.js';
1615

1716
const read = (p: string) => vol.readFileSync(p, 'utf8') as string;
1817

1918
const getShardedWal = (overrides?: {
2019
dir?: string;
21-
format?: Partial<WalFormat>;
20+
format?: Partial<WalFormat<WalRecord>>;
2221
autoCoordinator?: boolean;
2322
groupId?: string;
2423
}) => {
2524
const { format, ...rest } = overrides ?? {};
2625
return new ShardedWal({
2726
debug: false,
2827
dir: '/test/shards',
29-
format: parseWalFormat({
28+
format: {
3029
baseName: 'test-wal',
30+
walExtension: '.log',
31+
finalExtension: '.json',
32+
codec: stringCodec<WalRecord>(),
33+
finalizer: records => `${JSON.stringify(records)}\n`,
3134
...format,
32-
}),
35+
},
3336
coordinatorIdEnvVar: SHARDED_WAL_COORDINATOR_ID_ENV_VAR,
3437
...rest,
3538
});

0 commit comments

Comments
 (0)