Skip to content

Commit

Permalink
feat: add CJS export for cz-commitlint (#3963)
Browse files Browse the repository at this point in the history
* feat: add CJS export for cz-commitlint

relates to: #3850 (comment)

resolves #3949

* chore: add .cts to eslintrc

* fix: workaround cts issues of vitest and typescript
  • Loading branch information
frantic1048 authored Mar 11, 2024
1 parent f1dec32 commit 6ae3c6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
},
overrides: [
{
files: ['*.ts'],
files: ['*.cts', '*.ts'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/eslint-recommended',
Expand Down
4 changes: 4 additions & 0 deletions @commitlint/cz-commitlint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"version": "19.0.3",
"description": "Commitizen adapter using the commitlint.config.js",
"main": "./lib/index.js",
"exports": {
"import": "./lib/index.js",
"require": "./lib/index.cjs"
},
"files": [
"lib"
],
Expand Down
4 changes: 4 additions & 0 deletions @commitlint/cz-commitlint/src/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {Awaited<typeof import('./index.js')>['prompter']} */
exports.prompter = async (...args) => {
(await import('./index.js')).prompter(...args);
};

0 comments on commit 6ae3c6a

Please sign in to comment.