Skip to content

Commit

Permalink
fix(no-debug): ensure callee exists (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
marudor committed Feb 10, 2020
1 parent caeebb4 commit ba34a62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ module.exports = {

function isRenderFunction(callNode, renderFunctions) {
return ['render', ...renderFunctions].some(
name => name === callNode.callee.name
name => callNode.callee && name === callNode.callee.name
);
}

Expand Down
7 changes: 7 additions & 0 deletions tests/lib/rules/no-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ ruleTester.run('no-debug', rule, {
screen.debug()
`,
},
{
code: `
async function foo() {
const foo = await bar;
}
`,
},
],

invalid: [
Expand Down

0 comments on commit ba34a62

Please sign in to comment.