From 9d52df4d6468ba88b01c28d468ad050c99642d37 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 2 Mar 2026 10:47:11 -0800 Subject: [PATCH] ref: Set `@typescript-eslint/prefer-as-const` lint rule to `error` --- js/eslint.config.ts | 3 +-- js/src/logger.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/js/eslint.config.ts b/js/eslint.config.ts index 758bb855a..b45d6ba6b 100644 --- a/js/eslint.config.ts +++ b/js/eslint.config.ts @@ -84,8 +84,7 @@ export default [ "@typescript-eslint/no-empty-object-type": "warn", // TODO: Fix violations and re-enable as "error" "@typescript-eslint/no-unsafe-function-type": "warn", - // TODO: Fix violations and re-enable as "error" - "@typescript-eslint/prefer-as-const": "warn", + "@typescript-eslint/prefer-as-const": "error", // Require node: protocol for Node.js built-in imports (for Deno compatibility) // This plugin automatically detects ALL Node.js built-ins - no manual list needed! "node-import/prefer-node-protocol": "error", diff --git a/js/src/logger.ts b/js/src/logger.ts index af0b09927..0533ca85c 100644 --- a/js/src/logger.ts +++ b/js/src/logger.ts @@ -2155,7 +2155,7 @@ export class Logger implements Exportable { private calledStartSpan: boolean; // For type identification. - public kind: "logger" = "logger"; + public kind = "logger" as const; constructor( state: BraintrustState, @@ -6134,7 +6134,7 @@ export class SpanImpl implements Span { private _rootSpanId: string; private _spanParents: string[] | undefined; - public kind: "span" = "span"; + public kind = "span" as const; constructor( args: {