From 85ad18b8990567df516effcacbf04edbcbb6b6d7 Mon Sep 17 00:00:00 2001 From: Mohamed Lamine Allal Date: Thu, 22 Dec 2022 10:07:39 +0100 Subject: [PATCH] feat: support config .cts extension (#3461) --- @commitlint/load/src/utils/load-config.ts | 3 +++ README.md | 2 ++ 2 files changed, 5 insertions(+) diff --git a/@commitlint/load/src/utils/load-config.ts b/@commitlint/load/src/utils/load-config.ts index cedddb4d45..6c1d8d8e8a 100644 --- a/@commitlint/load/src/utils/load-config.ts +++ b/@commitlint/load/src/utils/load-config.ts @@ -29,10 +29,13 @@ export async function loadConfig( // files supported by TypescriptLoader `.${moduleName}rc.ts`, + `.${moduleName}rc.cts`, `${moduleName}.config.ts`, + `${moduleName}.config.cts`, ], loaders: { '.ts': TypeScriptLoader(), + '.cts': TypeScriptLoader(), }, }); diff --git a/README.md b/README.md index 78e3ea09e7..c73ecc93b4 100644 --- a/README.md +++ b/README.md @@ -135,9 +135,11 @@ Check the [husky documentation](https://typicode.github.io/husky/#/?id=manual) o - `.commitlintrc.js` - `.commitlintrc.cjs` - `.commitlintrc.ts` + - `.commitlintrc.cts` - `commitlint.config.js` - `commitlint.config.cjs` - `commitlint.config.ts` + - `commitlint.config.cts` - `commitlint` field in `package.json` - Packages: [cli](./@commitlint/cli), [core](./@commitlint/core) - See [Rules](./docs/reference-rules.md) for a complete list of possible rules