From 06771b0c61095a140c0d764654cc46bce7e395be Mon Sep 17 00:00:00 2001 From: Louis Chan Date: Mon, 9 Sep 2024 14:24:32 +0800 Subject: [PATCH] Add a test for issue 53 --- test/__snapshots__/test.js.snap | 3 ++- test/src/simple.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/__snapshots__/test.js.snap b/test/__snapshots__/test.js.snap index 5b9a992..877ff48 100644 --- a/test/__snapshots__/test.js.snap +++ b/test/__snapshots__/test.js.snap @@ -19,6 +19,7 @@ src/simple.ts:12:5: 'b' is assigned a value but never used. Allowed unused vars src/simple.ts:12:11: Unexpected number value in conditional. An explicit zero/NaN check is required. [Error/@typescript-eslint/strict-boolean-expressions] src/simple.ts:14:8: Function 'thisFunctionIsHardToComprehend' has a complexity of 14. Maximum allowed is 10. [Error/complexity] src/simple.ts:14:17: Refactor this function to reduce its Cognitive Complexity from 19 to the 10 allowed. [Error/sonarjs/cognitive-complexity] +src/simple.ts:55:25: 'unused' is defined but never used. Allowed unused args must match /^_/u. [Error/@typescript-eslint/no-unused-vars] -9 problems" +10 problems" `; diff --git a/test/src/simple.ts b/test/src/simple.ts index 8b42aac..2213d0a 100644 --- a/test/src/simple.ts +++ b/test/src/simple.ts @@ -51,3 +51,7 @@ export function issue43(a: "A" | "B"): number { return 2; } } + +export function issue53(unused: number): number { + return 0; +}