Skip to content

Commit

Permalink
fix(ruleset-migrator): use module for require.resolve (#2405)
Browse files Browse the repository at this point in the history
  • Loading branch information
dweber019 authored Feb 22, 2023
1 parent 97134a5 commit d7c0fa4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ruleset-migrator/src/requireResolve.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { createRequire } from 'module';

export default <NodeRequire['resolve'] | null>((id, opts) => {
try {
return require.resolve(id, opts);
const req = createRequire(process.cwd());
return req.resolve(id, opts);
} catch {
return null;
}
Expand Down

0 comments on commit d7c0fa4

Please sign in to comment.