Skip to content

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

Open
felixarntz wants to merge 12 commits intomainfrom
fa/fix-unused-vars-not-being-flagged
Open

chore: fix unused vars not being flagged by our lint tooling#14329
felixarntz wants to merge 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.

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

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