Skip to content

added missing testcase for no-ununsed-prop rule #3463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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