Skip to content

Commit

Permalink
added missing testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu007-creator committed Oct 14, 2022
1 parent bf59919 commit 6073df0
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions tests/lib/rules/no-unused-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3813,6 +3813,19 @@ ruleTester.run('no-unused-prop-types', rule, {
`,
features: ['types'],
},
{
code: `
type Props = {
username: string;
}
const App: React.VFC<Props> = (props) => {
return <div></div>;
}
`,
features: ['types'],
errors: [{ message: '\'username\' PropType is defined but prop is never used' }],
},
{
code: `
type Props = {
Expand Down Expand Up @@ -6343,7 +6356,7 @@ ruleTester.run('no-unused-prop-types', rule, {
],
},
{
// test same name of interface should be merge
// test same name of interface should be merge
code: `
interface Foo {
x: number;
Expand All @@ -6370,7 +6383,7 @@ ruleTester.run('no-unused-prop-types', rule, {
],
},
{
// test extends
// test extends
code: `
interface Foo {
x: number;
Expand All @@ -6392,7 +6405,7 @@ ruleTester.run('no-unused-prop-types', rule, {
],
},
{
// test extends
// test extends
code: `
interface Foo {
x: number;
Expand All @@ -6419,7 +6432,7 @@ ruleTester.run('no-unused-prop-types', rule, {
],
},
{
// test same name merge and extends
// test same name merge and extends
code: `
interface Foo {
x: number;
Expand All @@ -6446,7 +6459,7 @@ ruleTester.run('no-unused-prop-types', rule, {
],
},
{
// test same name merge and extends
// test same name merge and extends
code: `
interface Foo {
x: number;
Expand Down

0 comments on commit 6073df0

Please sign in to comment.