Closed
Description
Expected Behavior
Saving a commit message should work without any issue.
Current Behavior
Attempting to save a commit message will result in the following error being thrown:
/<REPO_ROOT>/node_modules/@commitlint/config-nx-scopes/index.js:1
import {RuleConfigSeverity} from '@commitlint/types';
^^^^^^
SyntaxError: Cannot use import statement outside a module
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
No response
Steps to Reproduce
Set up commitlint for nx:
const {
utils: { getProjects },
} = require('@commitlint/config-nx-scopes');
module.exports = {
extends: ['@commitlint/config-conventional', '@commitlint/config-nx-scopes'],
rules: {
'scope-enum': async (ctx) => [
2,
'always',
[
...(await getProjects(ctx)),
// Insert custom scopes below:
'root',
'release',
],
],
},
};
- Upgrade from 18.4.4 to 18.5.0
- Run
yarn commitment --edit
and notice that the commitlint CLI throws the aforementioned error
Context
No response
commitlint --version
@commitlint/cli@18.5.0
git --version
v2.41.0
node --version
v18.18.2