-
Notifications
You must be signed in to change notification settings - Fork 934
"require() of ES modules is not supported" when linting a commit #902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"require() of ES modules is not supported" when linting a commit #902
Comments
in theory you should be able to use
but this is not going to work as cosmiconfig is not supporting cjs files cosmiconfig/cosmiconfig#224 note: this can be fixed within @commitlint/loader by adding loader for those files |
This is interesting, thanks for reporting. We use |
How? |
How does one workaround this issue? PS: OK, I have tried passing the config with a |
Warning:
Changed my |
@RomanistHere I assume this will work after this is merged: #2797 |
This problem still exists
|
I feel like this is a regression as I have updated my commitlint recently to 19.1.0, reverting to 18.5.0 fixes the issue for me. The above amendments mentioned to the bash file did not work. |
Expected Behavior
commitlint should lint commit messages without errors.
Current Behavior
In a project whose
package.json
is configured as"type": "module"
,conventional-changelog/commitlint
produces the following error:Affected packages
Possible Solution
This seems related to how the underlying
cosmiconfig
package is loading thecommitlint
configuration.Steps to Reproduce (for bugs)
Reproduction repository: https://github.com/danielway/commitlint-esm-bug-repro
Your Environment
Commitlint: 8.3.5
Node: 12.14.1, 13.1.0, and 13.7.0 all exhibit this behavior
The text was updated successfully, but these errors were encountered: