fix: typescript errors (#5214)

This commit is contained in:
naman-bruno
2025-07-29 12:11:50 +05:30
committed by GitHub
parent 29e6470f7a
commit 780beb832e
7 changed files with 116 additions and 99 deletions

View File

@@ -27,6 +27,7 @@
"@rollup/plugin-typescript": "^9.0.2",
"@types/jest": "^29.5.11",
"@types/lodash": "^4.14.191",
"@types/node": "^24.1.0",
"babel-jest": "^29.7.0",
"jest": "^29.2.0",
"rimraf": "^3.0.2",
@@ -43,4 +44,4 @@
"@usebruno/lang": "0.12.0",
"lodash": "^4.17.21"
}
}
}

View File

@@ -61,13 +61,13 @@ const getWorkerInstance = (): BruParserWorker => {
process.exit(0);
});
process.on('uncaughtException', async (error) => {
process.on('uncaughtException', async (error: Error) => {
console.error('Uncaught Exception:', error);
await cleanup();
process.exit(1);
});
process.on('unhandledRejection', async (reason) => {
process.on('unhandledRejection', async (reason: unknown) => {
console.error('Unhandled Rejection:', reason);
await cleanup();
process.exit(1);
@@ -137,4 +137,4 @@ export const parseDotEnv = (content: string): Record<string, string> => {
};
export { BruParserWorker };
export * from './types';
export * from './types';

View File

@@ -1,4 +1,4 @@
import { Worker } from 'worker_threads';
import { Worker } from 'node:worker_threads';
interface QueuedTask {
priority: number;

View File

@@ -1,6 +1,6 @@
import WorkerQueue from "./WorkerQueue";
import { Lane } from "../types";
import path from "path";
import WorkerQueue from './WorkerQueue';
import { Lane } from '../types';
import path from 'node:path';
const sizeInMB = (size: number): number => {
return size / (1024 * 1024);

View File

@@ -1,4 +1,4 @@
import { parentPort } from 'worker_threads';
import { parentPort } from 'node:worker_threads';
import { bruRequestToJson, jsonRequestToBru } from '../formats/bru';
interface WorkerMessage {
@@ -24,4 +24,4 @@ parentPort?.on('message', async (message: WorkerMessage) => {
console.error('Worker error:', error);
parentPort?.postMessage({ error: error?.message });
}
});
});

View File

@@ -15,6 +15,8 @@
"declarationDir": "./dist/types",
"allowJs": true,
"checkJs": false,
"types": ["node"],
"lib": ["ES2020"],
"typeRoots": ["./node_modules/@types", "./src/types"]
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.d.ts"],