Skip to content

Commit

Permalink
Add test cases for other forms of empty functions in no-unused-prop-t…
Browse files Browse the repository at this point in the history
…ypes and remove parser option
  • Loading branch information
kevinzwhuang committed Dec 13, 2017
1 parent d331af6 commit 6015af2
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions tests/lib/rules/no-unused-prop-types.js
Expand Up @@ -2443,14 +2443,43 @@ ruleTester.run('no-unused-prop-types', rule, {
},
{
code: `
class MyComponent extends React.Component<Props> {
class MyComponent extends React.Component {
render() {
return <div>{ this.props.other }</div>
}
}
MyComponent.propTypes = { other: () => {} };
`,
parser: 'babel-eslint'
`
},
{
code: `
class MyComponent extends React.Component {
render() {
return <div>{ this.props.other }</div>
}
}
MyComponent.propTypes = { other() {} };
`
},
{
code: `
class MyComponent extends React.Component {
render() {
return <div>{ this.props.other }</div>
}
}
MyComponent.propTypes = { other: function () {} };
`
},
{
code: `
class MyComponent extends React.Component {
render() {
return <div>{ this.props.other }</div>
}
}
MyComponent.propTypes = { * other() {} };
`
}
],

Expand Down

0 comments on commit 6015af2

Please sign in to comment.