@@ -50498,7 +50498,7 @@ const resolveAndRequire = __nccwpck_require__(2034);
50498
50498
50499
50499
// Variables
50500
50500
const packageName = "markdownlint-cli2";
50501
- const packageVersion = "0.15 .0";
50501
+ const packageVersion = "0.16 .0";
50502
50502
const libraryName = "markdownlint";
50503
50503
const libraryVersion = getLibraryVersion();
50504
50504
const bannerMessage = `${packageName} v${packageVersion} (${libraryName} v${libraryVersion})`;
@@ -50565,11 +50565,18 @@ const importOrRequireResolve = async (dirOrDirs, id, noRequire) => {
50565
50565
const dirs = Array.isArray(dirOrDirs) ? dirOrDirs : [ dirOrDirs ];
50566
50566
const expandId = expandTildePath(id);
50567
50567
const errors = [];
50568
+ // Try to load via require(...)
50568
50569
try {
50569
- return resolveAndRequire(dynamicRequire, expandId, dirs);
50570
+ const isModule = /\.mjs$/iu.test(expandId);
50571
+ if (!isModule) {
50572
+ // Try not to use require for modules due to breaking change in Node 22.12:
50573
+ // https://github.com/nodejs/node/releases/tag/v22.12.0
50574
+ return resolveAndRequire(dynamicRequire, expandId, dirs);
50575
+ }
50570
50576
} catch (error) {
50571
50577
errors.push(error);
50572
50578
}
50579
+ // Try to load via import(...)
50573
50580
try {
50574
50581
// eslint-disable-next-line n/no-unsupported-features/node-builtins
50575
50582
const isURL = !pathDefault.isAbsolute(expandId) && URL.canParse(expandId);
@@ -50582,6 +50589,7 @@ const importOrRequireResolve = async (dirOrDirs, id, noRequire) => {
50582
50589
} catch (error) {
50583
50590
errors.push(error);
50584
50591
}
50592
+ // Give up
50585
50593
throw new AggregateError(
50586
50594
errors,
50587
50595
`Unable to require or import module '${id}'.`
0 commit comments