Skip to content

chore: fix unused vars not being flagged by our lint tooling#14329

Merged
felixarntz merged 12 commits intomainfrom
fa/fix-unused-vars-not-being-flagged
Apr 13, 2026
Merged

chore: fix unused vars not being flagged by our lint tooling#14329
felixarntz merged 12 commits intomainfrom
fa/fix-unused-vars-not-being-flagged

Conversation

@felixarntz
Copy link
Copy Markdown
Collaborator

@felixarntz felixarntz commented Apr 10, 2026

Summary

we have a ton of unused variables in our codebase. For some reason, the lint rules to flag these were disabled.

This PR fixes only the violations flagged by oxlint - it's already a bunch. We can open another PR for the TypeScript flagged problems.

oxlint finds many false positives in tests, and since this is less important for tests anyway, we can just disable the rule for test files.

To reduce the scope, we still ignore those errors in examples/ for now - also because some of the unused variables in examples are intentionally there.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

@tigent tigent bot added the maintenance CI, internal documentation, automations, etc label Apr 10, 2026
const weatherTool = tool({
description: 'Get the weather in a location',
inputSchema: z.object({ city: z.string() }),
execute: async ({ city }) => ({
Copy link
Copy Markdown
Collaborator

@lgrammel lgrammel Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of these in examples exist on purpose (for illustration), instead of removing an alternative would be to use them below

model,
tools: {
str_replace_editor: bedrockAnthropic.tools.textEditor_20241022({
async execute({ command, path, old_str, new_str, insert_text }) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even if they are not used would recommend keeping them in the ai function examples (for illustration etc)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabled the checks in tests, oxlint finds a ton of false positives there. with production code, the findings are much more reliable.

Comment thread packages/ai/src/generate-text/retention-benchmark.test.ts
Comment thread packages/ai/src/generate-text/stream-text.test.ts Outdated
Comment thread packages/xai/src/xai-image-model.test.ts Outdated
Comment thread packages/xai/src/xai-provider.test.ts Outdated
Comment thread examples/ai-functions/src/generate-text/anthropic/with-langfuse-telemetry.ts Outdated
Comment thread packages/vercel/src/vercel-provider.test.ts Outdated
Comment thread packages/togetherai/src/togetherai-provider.test.ts Outdated
Comment thread packages/open-responses/src/responses/open-responses-language-model.test.ts Outdated
Comment thread packages/luma/src/luma-image-model.ts Outdated
Comment thread packages/gateway/src/gateway-image-model.ts Outdated
static createContextualError({
apiKeyProvided,
oidcTokenProvided,
message = 'Authentication failed',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep? why was this removed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually unused, it did nothing if passed

Comment on lines 36 to 39
export function getGlobalTelemetryIntegration<
TOOLS extends ToolSet = ToolSet,
OUTPUT extends Output = Output,
_TOOLS extends ToolSet = ToolSet,
_OUTPUT extends Output = Output,
>(): (args?: {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generics should be removed

@felixarntz felixarntz merged commit 90e2d8a into main Apr 13, 2026
19 checks passed
@felixarntz felixarntz deleted the fa/fix-unused-vars-not-being-flagged branch April 13, 2026 12:57
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Apr 13, 2026

🚀 Published in:

Package Version
ai 7.0.0-beta.84
@ai-sdk/alibaba 2.0.0-beta.25
@ai-sdk/amazon-bedrock 5.0.0-beta.30
@ai-sdk/angular 3.0.0-beta.84
@ai-sdk/anthropic 4.0.0-beta.26
@ai-sdk/assemblyai 3.0.0-beta.20
@ai-sdk/azure 4.0.0-beta.29
@ai-sdk/baseten 2.0.0-beta.23
@ai-sdk/black-forest-labs 2.0.0-beta.19
@ai-sdk/bytedance 2.0.0-beta.19
@ai-sdk/cerebras 3.0.0-beta.23
@ai-sdk/codemod 4.0.0-beta.2
@ai-sdk/cohere 4.0.0-beta.20
@ai-sdk/deepgram 3.0.0-beta.19
@ai-sdk/deepinfra 3.0.0-beta.23
@ai-sdk/deepseek 3.0.0-beta.21
@ai-sdk/devtools 1.0.0-beta.12
@ai-sdk/elevenlabs 3.0.0-beta.19
@ai-sdk/fal 3.0.0-beta.19
@ai-sdk/fireworks 3.0.0-beta.23
@ai-sdk/gateway 4.0.0-beta.47
@ai-sdk/gladia 3.0.0-beta.19
@ai-sdk/google 4.0.0-beta.35
@ai-sdk/google-vertex 5.0.0-beta.45
@ai-sdk/groq 4.0.0-beta.22
@ai-sdk/huggingface 2.0.0-beta.23
@ai-sdk/hume 3.0.0-beta.19
@ai-sdk/klingai 4.0.0-beta.20
@ai-sdk/langchain 3.0.0-beta.84
@ai-sdk/llamaindex 3.0.0-beta.84
@ai-sdk/lmnt 3.0.0-beta.19
@ai-sdk/luma 3.0.0-beta.19
@ai-sdk/mcp 2.0.0-beta.25
@ai-sdk/mistral 4.0.0-beta.21
@ai-sdk/moonshotai 3.0.0-beta.23
@ai-sdk/open-responses 2.0.0-beta.21
@ai-sdk/openai 4.0.0-beta.29
@ai-sdk/openai-compatible 3.0.0-beta.23
@ai-sdk/otel 1.0.0-beta.30
@ai-sdk/perplexity 4.0.0-beta.22
@ai-sdk/prodia 2.0.0-beta.22
@ai-sdk/provider-utils 5.0.0-beta.18
@ai-sdk/react 4.0.0-beta.84
@ai-sdk/replicate 3.0.0-beta.20
@ai-sdk/revai 3.0.0-beta.20
@ai-sdk/rsc 3.0.0-beta.85
@ai-sdk/svelte 5.0.0-beta.84
@ai-sdk/togetherai 3.0.0-beta.23
@ai-sdk/valibot 3.0.0-beta.18
@ai-sdk/vercel 3.0.0-beta.23
@ai-sdk/vue 4.0.0-beta.84
@ai-sdk/xai 4.0.0-beta.34

lgrammel added a commit that referenced this pull request Apr 13, 2026
## Background

Generics are not necessary in `getGlobalTelemetryIntegration`. The two
calls for creating a unified telemetry can be reduced to one.

## Summary

* Remove generics from `getGlobalTelemetryIntegration`
* Rename `getGlobalTelemetryIntegration` to `createUnifiedTelemetry`
* Single function instead of two functions for creating unified
telemetry
* Remove `bindTelemetryIntegration` export

## Related Issues

Follow up from #14329
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance CI, internal documentation, automations, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants