From 2011cc1de796777bc4c77483183c85d63b6e52a2 Mon Sep 17 00:00:00 2001 From: Clay Chipps Date: Tue, 20 Feb 2024 16:28:08 -0500 Subject: [PATCH] feat: support identifying other root types --- src/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 8ace147d..0c1fdf6e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,8 +16,12 @@ function traverseFilePathUntil(filename: string, predicate: (filename: string) = } // Update to path.dirname(url.fileURLToPath(import.meta.url)) whenever we update tsconfig target to ES2020 -// eslint-disable-next-line unicorn/prefer-module -loadConfig.root = traverseFilePathUntil(require.main?.path ?? module.path, (p) => !p.includes('node_modules')) +/* eslint-disable unicorn/prefer-module */ +loadConfig.root = traverseFilePathUntil( + require.main?.path ?? module.path, + (p) => !(p.includes('node_modules') || p.includes('.pnpm') || p.includes('.yarn')), +) +/* eslint-enable unicorn/prefer-module */ export const test = fancy .register('loadConfig', loadConfig)