From cc71fe4afe049801e1a6b424a8b1cffe1c241531 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 10 Dec 2024 11:17:12 +0100 Subject: [PATCH] avoid lint error --- packages/babel-plugin-jest-hoist/src/index.ts | 2 +- scripts/lintTs.mjs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/babel-plugin-jest-hoist/src/index.ts b/packages/babel-plugin-jest-hoist/src/index.ts index c59632ce9e63..2885e386ac57 100644 --- a/packages/babel-plugin-jest-hoist/src/index.ts +++ b/packages/babel-plugin-jest-hoist/src/index.ts @@ -371,7 +371,7 @@ export default function jestHoist(): PluginObj<{ if (hoistedJestGetters.has(callExpr.node)) { const mockStmt = callExpr.getStatementParent(); - if (mockStmt?.parentPath.isBlock()) { + if (mockStmt && mockStmt.parentPath.isBlock()) { stack.at(-1)!.calls.push(mockStmt.node); mockStmt.remove(); } diff --git a/scripts/lintTs.mjs b/scripts/lintTs.mjs index 5f92e8380c9e..01c4d353a74d 100644 --- a/scripts/lintTs.mjs +++ b/scripts/lintTs.mjs @@ -111,6 +111,12 @@ try { '@typescript-eslint/no-redundant-type-constituents': 'off', }, }, + // { + // files: ['packages/babel-plugin-jest-hoist/src/index.ts'], + // rules: { + // '@typescript-eslint/strict-boolean-expressions': 'off', + // }, + // }, ], parser: '@typescript-eslint/parser', parserOptions: {