mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
fix(types): repair typecheck after oxlint safe autofix
The safe --fix introduced three type issues:
1. unicorn/prefer-set-has rewrote array literals to `new Set(...)`
without updating the `T[]` type annotation — broken assignment.
Fix type to `Set<T>` in logger.ts and agent-manager.ts.
2. unicorn/no-array-reverse changed `.reverse()` → `.toReversed()`
(ES2023). Bump `lib` to ES2023 in tsconfig.base.json and
tsconfig.server.json. Target stays at ES2020 — Node 20 supports
the methods natively, no downlevel needed.
3. preserve-caught-error added `new Error(msg, { cause })` (ES2022),
also covered by the lib bump.
This commit is contained in:
@@ -278,7 +278,7 @@ type SubscriptionRecord = {
|
|||||||
agentId: string | null;
|
agentId: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const BUSY_STATUSES: AgentLifecycleStatus[] = new Set(["initializing", "running"]);
|
const BUSY_STATUSES: Set<AgentLifecycleStatus> = new Set(["initializing", "running"]);
|
||||||
const AgentIdSchema = z.string().uuid();
|
const AgentIdSchema = z.string().uuid();
|
||||||
|
|
||||||
function isAgentBusy(status: AgentLifecycleStatus): boolean {
|
function isAgentBusy(status: AgentLifecycleStatus): boolean {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ type ResolveLogConfigOptions = {
|
|||||||
env?: NodeJS.ProcessEnv;
|
env?: NodeJS.ProcessEnv;
|
||||||
};
|
};
|
||||||
|
|
||||||
const LOG_LEVELS: LogLevel[] = new Set(["trace", "debug", "info", "warn", "error", "fatal"]);
|
const LOG_LEVELS: Set<LogLevel> = new Set(["trace", "debug", "info", "warn", "error", "fatal"]);
|
||||||
const LOG_FORMATS: LogFormat[] = ["pretty", "json"];
|
const LOG_FORMATS: LogFormat[] = ["pretty", "json"];
|
||||||
const LOG_LEVEL_PRIORITIES: Record<LogLevel, number> = {
|
const LOG_LEVEL_PRIORITIES: Record<LogLevel, number> = {
|
||||||
trace: 10,
|
trace: 10,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
"lib": ["ES2020", "DOM"],
|
"lib": ["ES2023", "DOM"],
|
||||||
"baseUrl": "./src",
|
"baseUrl": "./src",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@server/*": ["./*"]
|
"@server/*": ["./*"]
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "ES2020",
|
||||||
"lib": ["ES2020"],
|
"lib": ["ES2023"],
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user