diff --git a/actions/commitlint/README.md b/actions/commitlint/README.md index 1d2111e51..b4f8e2ad4 100644 --- a/actions/commitlint/README.md +++ b/actions/commitlint/README.md @@ -4,7 +4,7 @@ https://github.com/conventional-changelog/commitlint ## Simple configuration -1. `echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js` +1. `echo "export default {extends: ['@commitlint/config-conventional']}" > commitlint.config.mjs` 2. `trunk actions enable commitlint` This will install the basic config and run commitlint on every `commit-msg` hook. @@ -14,7 +14,7 @@ This will install the basic config and run commitlint on every `commit-msg` hook In order to use different commitlint configuration or specify a specific commitlint version, you must: -1. Modify your `commitlint.config.js` accordingly +1. Modify your `commitlint.config.mjs` accordingly 2. Override the `packages_file` field for the action and specify a package.json For example: @@ -30,10 +30,10 @@ actions: packages_file: ${workspace}/.trunk/commitlint/package.json ``` -`commitlint.config.js`: +`commitlint.config.mjs`: ```js -module.exports = { +export default { extends: ["@commitlint/config-angular", "@commitlint/config-conventional"], }; ``` diff --git a/actions/commitlint/commitlint.test.ts b/actions/commitlint/commitlint.test.ts index fe8402105..f9dd17fb1 100644 --- a/actions/commitlint/commitlint.test.ts +++ b/actions/commitlint/commitlint.test.ts @@ -4,8 +4,8 @@ import { TrunkActionDriver } from "tests/driver"; const preCheck = (driver: TrunkActionDriver) => { driver.writeFile( - "commitlint.config.js", - "module.exports = {extends: ['@commitlint/config-conventional']}", + "commitlint.config.mjs", + "export default {extends: ['@commitlint/config-conventional']}", ); }; diff --git a/actions/commitlint/package.json b/actions/commitlint/package.json index dedb725d5..972a41131 100644 --- a/actions/commitlint/package.json +++ b/actions/commitlint/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "@commitlint/cli": "^17.0", - "@commitlint/config-conventional": "^17.0" + "@commitlint/cli": "^19.0", + "@commitlint/config-conventional": "^19.0" } }