Skip to content

Commit

Permalink
test: add valid test case
Browse files Browse the repository at this point in the history
  • Loading branch information
developer-bandi committed Nov 10, 2024
1 parent 8556e91 commit 4d7cf19
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions packages/eslint-plugin/tests/rules/max-params.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ class Foo {
`,
options: [{ countVoidThis: true, max: 2 }],
},
{
code: `
declare function makeDate(m: number, d: number, y: number): Date;
`,
options: [{ max: 3 }],
},
{
code: `
type sum = (a: number, b: number) => number;
`,
options: [{ max: 2 }],
},
],
invalid: [
{ code: 'function foo(a, b, c, d) {}', errors: [{ messageId: 'exceed' }] },
Expand Down Expand Up @@ -100,17 +112,17 @@ class Foo {
},
{
code: `
function makeDate(m: number, d: number, y: number): Date;
declare function makeDate(m: number, d: number, y: number): Date;
`,
options: [{ max: 1 }],
errors: [{ messageId: 'exceed' }],
options: [{ max: 1 }],
},
{
code: `
type sum = (a: number, b:number) => number
type sum = (a: number, b: number) => number;
`,
options: [{ max: 1 }],
errors: [{ messageId: 'exceed' }],
options: [{ max: 1 }],
},
],
});

0 comments on commit 4d7cf19

Please sign in to comment.