diff --git a/tests/lib/rules/prefer-stateless-function.js b/tests/lib/rules/prefer-stateless-function.js index 6461c2f049..515c755d71 100644 --- a/tests/lib/rules/prefer-stateless-function.js +++ b/tests/lib/rules/prefer-stateless-function.js @@ -179,6 +179,16 @@ ruleTester.run('prefer-stateless-function', rule, { '});' ].join('\n'), parserOptions: parserOptions + }, { + // Can return null (shorthand if in return) + code: [ + 'class Foo extends React.Component {', + ' render() {', + ' return true ?
: null;', + ' }', + '}' + ].join('\n'), + parser: 'babel-eslint' }, { code: [ 'export default (Component) => (',