Skip to content

Commit

Permalink
Merge pull request #496 from ClayChipps/feature/support-other-root-types
Browse files Browse the repository at this point in the history
feat: support identifying other root types
  • Loading branch information
mdonnalley authored Feb 20, 2024
2 parents 6dff17d + 2011cc1 commit ca77aa3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ca77aa3

Please sign in to comment.