Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: add missing conditions param for moduleResolve
  • Loading branch information
JounQin committed Mar 7, 2024
commit 3786c2585bacfc43595b542aedc6e30d79e65298
4 changes: 3 additions & 1 deletion @commitlint/resolve-extends/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const pathSuffixes = [

const specifierSuffixes = ['', '.js', '.json', '/index.js', '/index.json'];

const conditions = new Set(['import', 'node']);

/**
* @see moduleResolve
*/
Expand All @@ -51,7 +53,7 @@ export const resolveFrom = (lookup: string, parent?: string): string => {

for (const suffix of specifierSuffixes) {
try {
return fileURLToPath(moduleResolve(lookup + suffix, base));
return fileURLToPath(moduleResolve(lookup + suffix, base, conditions));
} catch (err) {
if (!resolveError) {
resolveError = err as Error;
Expand Down