We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e571970 commit 82936c9Copy full SHA for 82936c9
@commitlint/resolve-extends/src/index.ts
@@ -1,3 +1,4 @@
1
+import { createRequire } from "node:module";
2
import fs from "node:fs";
3
import path from "node:path";
4
import { pathToFileURL, fileURLToPath } from "node:url";
@@ -10,6 +11,11 @@ import { validateConfig } from "@commitlint/config-validator";
10
11
import type { ParserPreset, UserConfig } from "@commitlint/types";
12
13
const dynamicImport = async <T>(id: string): Promise<T> => {
14
+ if (id.endsWith(".json")) {
15
+ const require = createRequire(import.meta.url);
16
+ return require(id);
17
+ }
18
+
19
const imported = await import(
20
path.isAbsolute(id) ? pathToFileURL(id).toString() : id
21
);
0 commit comments