|
2 | 2 |
|
3 | 3 | // Imports
|
4 | 4 | import fsNode from "node:fs";
|
5 |
| -import { createRequire } from "node:module"; |
6 |
| -const dynamicRequire = createRequire(import.meta.url); |
7 | 5 | import os from "node:os";
|
8 | 6 | import pathDefault from "node:path";
|
9 | 7 | const pathPosix = pathDefault.posix;
|
10 | 8 | import { pathToFileURL } from "node:url";
|
11 | 9 | import { globby } from "globby";
|
12 | 10 | import micromatch from "micromatch";
|
13 |
| -import { applyFixes, getVersion } from "markdownlint"; |
| 11 | +import { applyFixes, getVersion, resolveModule } from "markdownlint"; |
14 | 12 | import { lint, extendConfig, readConfig } from "markdownlint/promise";
|
15 | 13 | import { expandTildePath } from "markdownlint/helpers";
|
16 | 14 | import appendToArray from "./append-to-array.mjs";
|
17 | 15 | import mergeOptions from "./merge-options.mjs";
|
18 |
| -import resolveModule from "./resolve-module.mjs"; |
19 | 16 | import parsers from "./parsers/parsers.mjs";
|
20 | 17 | import jsoncParse from "./parsers/jsonc-parse.mjs";
|
21 | 18 | import yamlParse from "./parsers/yaml-parse.mjs";
|
@@ -78,7 +75,7 @@ const importModule = async (dirOrDirs, id, noImport) => {
|
78 | 75 | let moduleName = null;
|
79 | 76 | try {
|
80 | 77 | try {
|
81 |
| - moduleName = pathToFileURL(resolveModule(dynamicRequire, expandId, dirs)); |
| 78 | + moduleName = pathToFileURL(resolveModule(expandId, dirs)); |
82 | 79 | } catch (error) {
|
83 | 80 | errors.push(error);
|
84 | 81 | moduleName =
|
|
0 commit comments