Skip to content

Commit 6015af2

Browse files
committed
Add test cases for other forms of empty functions in no-unused-prop-types and remove parser option
1 parent d331af6 commit 6015af2

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

tests/lib/rules/no-unused-prop-types.js

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,14 +2443,43 @@ ruleTester.run('no-unused-prop-types', rule, {
24432443
},
24442444
{
24452445
code: `
2446-
class MyComponent extends React.Component<Props> {
2446+
class MyComponent extends React.Component {
24472447
render() {
24482448
return <div>{ this.props.other }</div>
24492449
}
24502450
}
24512451
MyComponent.propTypes = { other: () => {} };
2452-
`,
2453-
parser: 'babel-eslint'
2452+
`
2453+
},
2454+
{
2455+
code: `
2456+
class MyComponent extends React.Component {
2457+
render() {
2458+
return <div>{ this.props.other }</div>
2459+
}
2460+
}
2461+
MyComponent.propTypes = { other() {} };
2462+
`
2463+
},
2464+
{
2465+
code: `
2466+
class MyComponent extends React.Component {
2467+
render() {
2468+
return <div>{ this.props.other }</div>
2469+
}
2470+
}
2471+
MyComponent.propTypes = { other: function () {} };
2472+
`
2473+
},
2474+
{
2475+
code: `
2476+
class MyComponent extends React.Component {
2477+
render() {
2478+
return <div>{ this.props.other }</div>
2479+
}
2480+
}
2481+
MyComponent.propTypes = { * other() {} };
2482+
`
24542483
}
24552484
],
24562485

0 commit comments

Comments
 (0)