From e74d93f133a69c40ac66276bdaa3440ccbbdd8ee Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Fri, 23 Apr 2021 12:31:28 -0700 Subject: [PATCH] test: add function parameter trailing comma test case to radix rule --- tests/lib/rules/radix.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/lib/rules/radix.js b/tests/lib/rules/radix.js index 6aedda0e806a..315f7bac70da 100644 --- a/tests/lib/rules/radix.js +++ b/tests/lib/rules/radix.js @@ -80,6 +80,15 @@ ruleTester.run("radix", rule, { suggestions: [{ messageId: "addRadixParameter10", output: "parseInt(\"10\", 10);" }] }] }, + { + code: "parseInt(\"10\",);", // Function parameter with trailing comma + parserOptions: { ecmaVersion: 2017 }, + errors: [{ + messageId: "missingRadix", + type: "CallExpression", + suggestions: [{ messageId: "addRadixParameter10", output: "parseInt(\"10\", 10,);" }] + }] + }, { code: "parseInt(\"10\", null);", errors: [{