Skip to content

Commit

Permalink
test: add function parameter trailing comma test case to radix rule
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Apr 23, 2021
1 parent 45434b4 commit e74d93f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/lib/rules/radix.js
Expand Up @@ -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: [{
Expand Down

0 comments on commit e74d93f

Please sign in to comment.