From 845c4ffa0bbaef0adc3147d3b0f3b4ed424b7744 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Fri, 19 Jan 2024 11:38:13 +0530 Subject: [PATCH] fix(regression): fix outline crash! --- .eslintrc.json | 3 ++- typescript/src/getPatchedNavTree.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index acf9be1..de10df0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -33,7 +33,8 @@ "unicorn/switch-case-braces": "off", "@typescript-eslint/consistent-type-imports": "off", "@typescript-eslint/ban-types": "off", - "sonarjs/prefer-single-boolean-return": "off" + "sonarjs/prefer-single-boolean-return": "off", + "unicorn/no-typeof-undefined": "off" // todo disable globally }, "overrides": [ { diff --git a/typescript/src/getPatchedNavTree.ts b/typescript/src/getPatchedNavTree.ts index cf7a94a..158d1b8 100644 --- a/typescript/src/getPatchedNavTree.ts +++ b/typescript/src/getPatchedNavTree.ts @@ -10,7 +10,7 @@ type AdditionalFeatures = Record<'arraysTuplesNumberedItems', boolean> const getPatchedNavModule = (additionalFeatures: AdditionalFeatures): { getNavigationTree(...args) } => { // what is happening here: grabbing & patching NavigationBar module contents from actual running JS - const tsServerPath = __TS_SEVER_PATH__ === undefined ? require.main!.filename : __TS_SEVER_PATH__ + const tsServerPath = typeof __TS_SEVER_PATH__ === 'undefined' ? require.main!.filename : __TS_SEVER_PATH__ // current lib/tsserver.js const mainScript = nodeModules!.fs.readFileSync(tsServerPath, 'utf8') type PatchData = {