Skip to content

Commit

Permalink
fix(config-conventional): use default export (#3911)
Browse files Browse the repository at this point in the history
* fix(config-conventional): use default export

* fix(config-conventional): use exports

* fix(config-conventional): add esm wrapper
  • Loading branch information
dargmuesli committed Feb 14, 2024
1 parent 16f5949 commit bc48408
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions @commitlint/config-conventional/package.json
Expand Up @@ -3,6 +3,13 @@
"version": "18.6.1",
"description": "Shareable commitlint config enforcing conventional commits",
"main": "lib/index.js",
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./wrapper.mjs",
"require": "./lib/index.js"
}
},
"files": [
"lib/"
],
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/config-conventional/src/index.test.ts
@@ -1,5 +1,5 @@
import lint from '@commitlint/lint';
import {config} from '.';
import config from '.';

const commitLint = async (message) => {
const preset = await require(config.parserPreset)();
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/config-conventional/src/index.ts
Expand Up @@ -4,7 +4,7 @@ import {
TargetCaseType,
} from '@commitlint/types';

export const config = {
export = {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'body-leading-blank': [RuleConfigSeverity.Warning, 'always'] as const,
Expand Down
4 changes: 4 additions & 0 deletions @commitlint/config-conventional/wrapper.mjs
@@ -0,0 +1,4 @@
import config, {parserPreset, prompt, rules} from './lib';

export {parserPreset, prompt, rules};
export default config;

0 comments on commit bc48408

Please sign in to comment.