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: dependencies tree for typing needs fine-tunning #4107

Open
1 of 4 tasks
eladchen opened this issue Jul 28, 2024 · 2 comments
Open
1 of 4 tasks

fix: dependencies tree for typing needs fine-tunning #4107

eladchen opened this issue Jul 28, 2024 · 2 comments
Labels

Comments

@eladchen
Copy link

eladchen commented Jul 28, 2024

Steps to Reproduce

  1. In a new typescript project install the following:

typescript@latest @commitlint/cli@19.3.0 conventional-commits-parser@6.0.0

  1. import conventional-commits-parser and notice how the types are missing

Current Behavior

When Installing @commitlint/cli@19.3.0 @commitlint/types@19.0.3 is also installed

https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/cli/package.json#L55C6-L55C23

Which breaks typing when conventional-commits-parser@6.0.0 is installed.

typescript will complain about commit parser having no exported member 'CommitParser'
import { CommitParser } from "conventional-commits-parser";

https://github.com/conventional-changelog/conventional-changelog/blob/d3b8aaa16337993bbad4d91db1ffac5a7568756b/packages/conventional-commits-parser/src/CommitParser.ts#L42

Expected Behavior

Installing @commitlint/cli & conventional-commits-parser should result in the correct typings

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Context

No response

commitlint --version

@commitlint/cli@19.3.0

git --version

2.41.0

node --version

22.4.0

@eladchen eladchen added the bug label Jul 28, 2024
@eladchen
Copy link
Author

The workaround I'm using is to add the below entry to the tsconfig file

"paths": {
      "conventional-commits-parser": [
        "node_modules/conventional-commits-parser/dist"
      ]
},

@escapedcat
Copy link
Member

The PR to support v6 is still open: #4064
Happy for help

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

No branches or pull requests

2 participants