Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions js/eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ export default [
"warn",
{ assertionStyle: "never" },
],
// TODO: Fix violations and re-enable as "error"
"no-unused-expressions": ["warn", { allowShortCircuit: true }],
"no-unused-expressions": ["error", { allowShortCircuit: true }],
"@typescript-eslint/no-unused-expressions": "off",
// TODO: Fix violations and re-enable as "error"
"@typescript-eslint/no-empty-object-type": "warn",
// TODO: Fix violations and re-enable as "error"
"@typescript-eslint/no-unsafe-function-type": "warn",
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-unsafe-function-type": "error",
"@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!
Expand Down Expand Up @@ -150,9 +147,8 @@ export default [
"@typescript-eslint": tseslint,
},
rules: {
// TODO: Fix violations and re-enable as "error"
"no-restricted-syntax": [
"warn",
"error",
{
selector: "ExportAllDeclaration[exported=null]",
message:
Expand Down
1 change: 1 addition & 0 deletions js/src/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ import { configureBrowser } from "./config";

configureBrowser();

// eslint-disable-next-line no-restricted-syntax
export * from "../exports";
export * as default from "../exports";
1 change: 1 addition & 0 deletions js/src/edge-light/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ import { configureEdgeLight } from "./config";

configureEdgeLight();

// eslint-disable-next-line no-restricted-syntax
export * from "../exports";
export * as default from "../exports";
4 changes: 2 additions & 2 deletions js/src/instrumentation/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ export interface ErrorEvent extends BaseContext {
* Event emitted when a promise begins to settle.
* This fires after the synchronous portion and when the async continuation starts.
*/
export interface AsyncStartEvent<TInput = unknown> extends StartEvent<TInput> {}
export type AsyncStartEvent<TInput = unknown> = StartEvent<TInput>;

/**
* Event emitted when a promise finishes settling.
* This fires BEFORE control returns to user code after await.
* This is where you should extract output data and finalize spans.
*/
export interface AsyncEndEvent<TResult = unknown> extends EndEvent<TResult> {}
export type AsyncEndEvent<TResult = unknown> = EndEvent<TResult>;

/**
* Subscription handlers for a TracingChannel.
Expand Down
4 changes: 3 additions & 1 deletion js/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6503,6 +6503,7 @@ export class SpanImpl implements Span {
default: {
// trigger a compile-time error if we add a new object type
const _exhaustive: never = this.parentObjectType;
// eslint-disable-next-line no-unused-expressions
_exhaustive;
return NOOP_SPAN_PERMALINK;
}
Expand Down Expand Up @@ -6944,7 +6945,8 @@ export type CompiledPrompt<Flavor extends "chat" | "completion"> =
? ChatPrompt
: Flavor extends "completion"
? CompletionPrompt
: {});
: // eslint-disable-next-line @typescript-eslint/no-empty-object-type
{});

export type DefaultPromptArgs = Partial<
CompiledPromptParams & AnyModelParam & ChatPrompt & CompletionPrompt
Expand Down
1 change: 1 addition & 0 deletions js/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ import { configureNode } from "./config";

configureNode();

// eslint-disable-next-line no-restricted-syntax
export * from "../exports";
export * as default from "../exports";
1 change: 1 addition & 0 deletions js/src/workerd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ import { configureWorkerd } from "./config";

configureWorkerd();

// eslint-disable-next-line no-restricted-syntax
export * from "../exports";
export * as default from "../exports";
4 changes: 2 additions & 2 deletions js/src/wrappers/claude-agent-sdk/claude-agent-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -981,13 +981,13 @@ export function wrapClaudeAgentSDK<T extends object>(sdk: T): T {
// Tool tracing is now handled via PreToolUse/PostToolUse hooks injected in wrapClaudeAgentQuery.
// We just pass through the original tool function - no need to wrap it.
if (prop === "tool" && typeof value === "function") {
const bound = (value as Function).bind(target);
const bound = value.bind(target);
cache.set(prop, bound);
return bound;
}

if (typeof value === "function") {
const bound = (value as Function).bind(target);
const bound = value.bind(target);
cache.set(prop, bound);
return bound;
}
Expand Down
4 changes: 2 additions & 2 deletions js/src/wrappers/oai_responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function traceResponseCreateStream(
};
}

function parseLogFromItem(item: any): {} {
function parseLogFromItem(item: any): Record<string, unknown> {
if (!item || !item?.type || !item?.response) {
return {};
}
Expand Down Expand Up @@ -323,7 +323,7 @@ export function parseMetricsFromUsage(usage: unknown): Record<string, number> {
}

type ParamsToSpanFunc = (params: any) => TimedSpan;
type ResultToEventFunc = (result: any) => {};
type ResultToEventFunc = (result: any) => Record<string, unknown>;
type TraceStreamFunc = (stream: AsyncIterator<any>, span: TimedSpan) => void;

type CreateProxyHooks = {
Expand Down
Loading