Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(load): fixes a bug when a ts commitlint config is compiled twice
  • Loading branch information
mailaenderli committed Jan 12, 2023
commit 7dcbbb470ecb845d0d09dd7e6e5e100194180039
5 changes: 3 additions & 2 deletions @commitlint/load/src/utils/load-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export async function loadConfig(
configPath?: string
): Promise<LoadConfigResult | null> {
const moduleName = 'commitlint';
const tsLoader = TypeScriptLoader();
const explorer = cosmiconfig(moduleName, {
searchPlaces: [
// cosmiconfig overrides default searchPlaces if any new search place is added (For e.g. `*.ts` files),
Expand All @@ -34,8 +35,8 @@ export async function loadConfig(
`${moduleName}.config.cts`,
],
loaders: {
'.ts': TypeScriptLoader(),
'.cts': TypeScriptLoader(),
'.ts': tsLoader,
'.cts': tsLoader,
},
});

Expand Down