Skip to content
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

fix: SyntaxError after upgrading from 18.4.4 → 18.5.0 #3865

Closed
1 of 4 tasks
terrymun opened this issue Jan 22, 2024 · 3 comments · Fixed by #3867
Closed
1 of 4 tasks

fix: SyntaxError after upgrading from 18.4.4 → 18.5.0 #3865

terrymun opened this issue Jan 22, 2024 · 3 comments · Fixed by #3867
Labels

Comments

@terrymun
Copy link

terrymun commented Jan 22, 2024

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',
      ],
    ],
  },
};

  1. Upgrade from 18.4.4 to 18.5.0
  2. 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

@escapedcat
Copy link
Member

https://github.com/conventional-changelog/commitlint/releases/tag/v18.5.1

@terrymun
Copy link
Author

terrymun commented Jan 22, 2024

@escapedcat and @marcalexiei Thank you for looking into that so quickly! ❤️

@escapedcat
Copy link
Member

@escapedcat Thank you for looking into that so quickly!

That's all done by @marcalexiei ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants