Skip to content

Commit dc2c899

Browse files
authoredJan 12, 2023
fix(load): fixes a bug when a ts commitlint config is compiled twice (#3499)
1 parent d8773ad commit dc2c899

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎@commitlint/load/src/utils/load-config.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export async function loadConfig(
1313
configPath?: string
1414
): Promise<LoadConfigResult | null> {
1515
const moduleName = 'commitlint';
16+
const tsLoader = TypeScriptLoader();
1617
const explorer = cosmiconfig(moduleName, {
1718
searchPlaces: [
1819
// cosmiconfig overrides default searchPlaces if any new search place is added (For e.g. `*.ts` files),
@@ -34,8 +35,8 @@ export async function loadConfig(
3435
`${moduleName}.config.cts`,
3536
],
3637
loaders: {
37-
'.ts': TypeScriptLoader(),
38-
'.cts': TypeScriptLoader(),
38+
'.ts': tsLoader,
39+
'.cts': tsLoader,
3940
},
4041
});
4142

0 commit comments

Comments
 (0)
Please sign in to comment.