Skip to content

fix: footer parser does not escape special chars for regex #4560#4634

Merged
escapedcat merged 2 commits intomasterfrom
chore/deps-260303
Mar 3, 2026
Merged

fix: footer parser does not escape special chars for regex #4560#4634
escapedcat merged 2 commits intomasterfrom
chore/deps-260303

Conversation

@escapedcat
Copy link
Member

@escapedcat escapedcat commented Mar 3, 2026

  • deps
  • add @types/conventional-commits-parser to resolve TS7016
  • test

Fixes: #4560

@qodo-code-review
Copy link

Review Summary by Qodo

Add @types/conventional-commits-parser to fix TypeScript TS7016 error

🐞 Bug fix ✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add @types/conventional-commits-parser to resolve TS7016 error
• Dependency added to both @commitlint/cli and @commitlint/rules packages
Diagram
flowchart LR
  A["TS7016 Error\n(missing type declarations)"] -- "add @types/conventional-commits-parser ^5.0.2" --> B["@commitlint/cli\npackage.json"]
  A -- "add @types/conventional-commits-parser ^5.0.2" --> C["@commitlint/rules\npackage.json"]
Loading

Grey Divider

File Changes

1. @commitlint/cli/package.json Dependencies +1/-0

Add missing TypeScript types for conventional-commits-parser

• Added @types/conventional-commits-parser version ^5.0.2 to devDependencies

@commitlint/cli/package.json


2. @commitlint/rules/package.json Dependencies +1/-0

Add missing TypeScript types for conventional-commits-parser

• Added @types/conventional-commits-parser version ^5.0.2 to devDependencies

@commitlint/rules/package.json


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 3, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Fragile hoisted type dependency 🐞 Bug ⛯ Reliability
Description
@types/conventional-commits-parser is added only to @commitlint/cli/@commitlint/rules, while
@commitlint/types and @commitlint/parse also import conventional-commits-parser types and
publish .d.ts files. This makes builds and consumer typing resolution depend on monorepo hoisting
rather than explicit package dependencies, which can break in focused/isolated installs and for
downstream TS users.
Code

@commitlint/cli/package.json[44]

+    "@types/conventional-commits-parser": "^5.0.2",
Evidence
The repo publishes declaration files from @commitlint/types and @commitlint/parse and those
declarations are derived from source that directly imports conventional-commits-parser types; yet
those packages do not declare @types/conventional-commits-parser. The PR adds the @types package
only in other workspaces, so @commitlint/types/@commitlint/parse will only succeed if the
dependency is hoisted into a shared node_modules, which is not guaranteed under focused installs /
stricter workspace setups.

@commitlint/cli/package.json[41-50]
@commitlint/types/package.json[1-10]
@commitlint/types/src/parse.ts[1-6]
@commitlint/types/package.json[31-37]
@commitlint/parse/package.json[1-10]
@commitlint/parse/src/index.ts[1-7]
@commitlint/parse/package.json[38-46]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`@commitlint/types` and `@commitlint/parse` import types from `conventional-commits-parser` and publish `.d.ts` files, but they do not declare `@types/conventional-commits-parser`. The PR adds the types package only to other workspaces, which makes type resolution depend on workspace hoisting and can break in focused/isolated installs and for downstream TS consumers.

### Issue Context
- `@commitlint/types` exports types referencing `conventional-commits-parser`.
- `@commitlint/parse` exports a function whose signature uses `Commit`/`ParserOptions` from `conventional-commits-parser`.

### Fix Focus Areas
- @commitlint/types/package.json[31-38]
- @commitlint/parse/package.json[38-47]
- @commitlint/types/src/parse.ts[1-6]
- @commitlint/parse/src/index.ts[1-7]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Verify @types compatibility 🐞 Bug ✓ Correctness
Description
The repo uses conventional-commits-parser ^6.2.1 but the PR adds
@types/conventional-commits-parser ^5.0.2. This may be fine, but the major-version mismatch
should be verified to avoid incorrect typings or future typecheck breakage.
Code

@commitlint/rules/package.json[R42-45]

+    "@types/conventional-commits-parser": "^5.0.2",
    "conventional-changelog-angular": "^8.1.0",
    "conventional-commits-parser": "^6.2.1",
    "glob": "^11.0.0"
Evidence
The PR introduces a v5 @types/* package alongside a v6 runtime dependency. Even if this compiles
today, it’s a risk area: type definitions could be out of sync with the installed library’s API
surface.

@commitlint/rules/package.json[38-46]
@commitlint/types/package.json[31-34]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
There is a major-version mismatch between the runtime library (`conventional-commits-parser@^6.2.1`) and the added type package (`@types/conventional-commits-parser@^5.0.2`). This could cause subtle type inaccuracies or future typecheck failures.

### Issue Context
The mismatch is introduced by the PR dependency addition.

### Fix Focus Areas
- @commitlint/rules/package.json[38-46]
- @commitlint/cli/package.json[41-48]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@escapedcat escapedcat changed the title fix: add @types/conventional-commits-parser to resolve TS7016 feat: deps Mar 3, 2026
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 3, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@escapedcat escapedcat changed the title feat: deps feat: conventional-commits-parser and other deps Mar 3, 2026
@escapedcat escapedcat requested a review from Copilot March 3, 2026 15:28
@escapedcat escapedcat changed the title feat: conventional-commits-parser and other deps chore conventional-commits-parser and other deps Mar 3, 2026
@escapedcat escapedcat changed the title chore conventional-commits-parser and other deps chore: conventional-commits-parser and other deps Mar 3, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the monorepo’s dependency set—centered around upgrading conventional-commits-parser—and adds TypeScript typings to address missing type definitions during TS compilation (TS7016), in the context of issue #4560.

Changes:

  • Bump conventional-commits-parser to ^6.3.0 across commitlint packages and update related conventional-changelog presets.
  • Add @types/conventional-commits-parser to relevant workspaces to satisfy TypeScript type resolution.
  • Refresh various toolchain deps (ESLint, SWC, Vue, cosmiconfig) and regenerate yarn.lock.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
yarn.lock Lockfile regeneration reflecting updated versions and newly added transitive deps (e.g., @simple-libs/stream-utils).
package.json Tooling dependency bumps (ESLint, SWC, TS ESLint) and Vue update; removes @eslint/js.
@commitlint/types/package.json Upgrades conventional-commits-parser to ^6.3.0 for shared types package.
@commitlint/rules/package.json Adds @types/conventional-commits-parser and bumps parser + changelog-angular preset.
@commitlint/parse/package.json Bumps parser + changelog-angular preset used by the core parsing layer.
@commitlint/load/package.json Updates cosmiconfig to ^9.0.1.
@commitlint/load/fixtures/parser-preset-conventionalcommits/package.json Bumps conventional-changelog-conventionalcommits fixture version.
@commitlint/load/fixtures/parser-preset-conventional-without-factory/package.json Bumps conventional-changelog-conventionalcommits fixture version.
@commitlint/config-conventional/package.json Bumps conventional-changelog-conventionalcommits.
@commitlint/cli/package.json Adds @types/conventional-commits-parser to support TS type imports in CLI sources.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@escapedcat escapedcat changed the title chore: conventional-commits-parser and other deps fix: add @types/conventional-commits-parser to resolve TS7016 #4560 Mar 3, 2026
@escapedcat escapedcat changed the title fix: add @types/conventional-commits-parser to resolve TS7016 #4560 fix: footer parser does not escape special chars for regex #4560 Mar 3, 2026
@escapedcat escapedcat requested a review from Copilot March 3, 2026 17:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This was referenced Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

fix: footer parser does not escape special chars for regex

2 participants