Skip to content

Commit

Permalink
get rid of ts ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Nov 1, 2020
1 parent c09dcc7 commit 2e62880
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/babel-plugin-jest-hoist/src/index.ts
Expand Up @@ -142,11 +142,10 @@ FUNCTIONS.mock = args => {
if (!isAllowedIdentifier) {
const binding = scope.bindings[name];

if (binding) {
// @ts-expect-error `init` does not exist
if (binding?.path.isVariableDeclarator()) {
const initNode = binding.path.node.init;

if (binding.constant && scope.isPure(initNode, true)) {
if (initNode && binding.constant && scope.isPure(initNode, true)) {
// replace the reference with its constant value
id.replaceWith(initNode);

Expand Down

0 comments on commit 2e62880

Please sign in to comment.