From e0f04a625920b1c098f7f2c492ccd3376f755bcc Mon Sep 17 00:00:00 2001 From: Andrii Bodnar <29282228+andrii-bodnar@users.noreply.github.com> Date: Fri, 25 Sep 2026 17:34:57 +0300 Subject: [PATCH] chore(lint): fail on unused variables, imports and parameters Biome's recommended preset only warns on these, so unused module-local code passed CI. Knip doesn't cover non-exported symbols. Co-Authored-By: Claude Opus 5.5 --- biome.json | 5 +++++ tests/unit/cli/commands/download/DownloadCommand.test.ts | 2 +- tests/unit/cli/commands/file/FileCommand.test.ts | 2 +- tests/unit/cli/commands/language/LanguageCommand.test.ts | 7 +------ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/biome.json b/biome.json index 21f22c1d8..845556dcb 100644 --- a/biome.json +++ b/biome.json @@ -10,6 +10,11 @@ "enabled": true, "rules": { "recommended": true, + "correctness": { + "noUnusedVariables": "error", + "noUnusedImports": "error", + "noUnusedFunctionParameters": "error" + }, "style": { "useImportType": "error" } diff --git a/tests/unit/cli/commands/download/DownloadCommand.test.ts b/tests/unit/cli/commands/download/DownloadCommand.test.ts index 67f9b8f17..331527752 100644 --- a/tests/unit/cli/commands/download/DownloadCommand.test.ts +++ b/tests/unit/cli/commands/download/DownloadCommand.test.ts @@ -108,7 +108,7 @@ describe('DownloadCommand', () => { const createDownloadCommand = (configOverrides: Partial = {}) => { return new DownloadCommand( - async (command: Command) => ({ + async () => ({ ...config, basePath: tempDir, ...configOverrides, diff --git a/tests/unit/cli/commands/file/FileCommand.test.ts b/tests/unit/cli/commands/file/FileCommand.test.ts index eab43ef89..2ef9aa76b 100644 --- a/tests/unit/cli/commands/file/FileCommand.test.ts +++ b/tests/unit/cli/commands/file/FileCommand.test.ts @@ -941,7 +941,7 @@ describe('FileCommand', () => { deleteProjectFile, }; const fileCommand = new FileCommand( - async (command: Command) => ({ ...config, basePath: tempDir }), + async () => ({ ...config, basePath: tempDir }), () => output, async () => projectService as never, async () => storageService, diff --git a/tests/unit/cli/commands/language/LanguageCommand.test.ts b/tests/unit/cli/commands/language/LanguageCommand.test.ts index 2bacc4f7d..1e2f2fc05 100644 --- a/tests/unit/cli/commands/language/LanguageCommand.test.ts +++ b/tests/unit/cli/commands/language/LanguageCommand.test.ts @@ -249,12 +249,7 @@ describe('LanguageCommand', () => { }, } as never); - await new LanguageCommand( - () => output, - async () => projectService, - async () => languageService, - async () => config, - ).listAction(commandContext); + await languageCommand.listAction(commandContext); // list() writes a line per item, where the old formatter joined them into a single write. expect(console.log).toHaveBeenCalledWith('fr');