Skip to content

Commit d43669d

Browse files
committed
docs: add a note about configuration under node24
1 parent 206dff1 commit d43669d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ These can be modified by [your own configuration](#config).
118118
- See [Rules](./docs/reference/rules.md) for a complete list of possible rules
119119
- An example configuration can be found at [@commitlint/config-conventional](./@commitlint/config-conventional/src/index.ts)
120120

121+
### Important note about Node 24+
122+
123+
Node v24 changes the way that modules are loaded, and this includes the commitlint config file. If your project does not contain a `package.json`, commitlint may fail to load the config, resulting in a `Please add rules to your commitlint.config.js` error message. This can be fixed by doing either of the following:
124+
125+
- Add a `package.json` file, declaring your project as an ES6 module. This can be done easily by running `npm init es6`.
126+
- Rename the config file from `commitlint.config.js` to `commitlint.config.mjs`.
127+
121128
## Shared configuration
122129

123130
A number of shared configurations are available to install and use with `commitlint`:

0 commit comments

Comments
 (0)