Skip to content

Commit

Permalink
fix(load): fixes a bug when a ts commitlint config is compiled twice (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mailaenderli committed Jan 12, 2023
1 parent d8773ad commit dc2c899
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions @commitlint/load/src/utils/load-config.ts
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

0 comments on commit dc2c899

Please sign in to comment.