We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93bd142 commit c7400c1Copy full SHA for c7400c1
lib/rules/prefer-output-null.js
@@ -40,8 +40,11 @@ module.exports = {
40
* @returns {Node} found node; if not found, return null;
41
*/
42
function getTestInfo (key) {
43
- const res = test.properties.filter(item => item.key.name === key);
44
- return res.length ? res[res.length - 1] : null;
+ if (test.type === 'ObjectExpression') {
+ const res = test.properties.filter(item => item.key.name === key);
45
+ return res.length ? res[res.length - 1] : null;
46
+ }
47
+ return key === 'code' ? test : null;
48
}
49
50
const code = getTestInfo('code');
0 commit comments