Fix Commit with Scope

Understand how to write a fix commit with a scope in parentheses. Learn the correct format for scoped Conventional Commits messages.

Valid Formats

Detailed Explanation

Scoped Fix Commits

Adding a scope to a commit message provides extra context about which part of the codebase is affected. The scope is placed in parentheses between the type and the colon separator.

Format

fix(parser): handle escaped quotes in strings

Breaking this down:

Element Value Purpose
Type fix Declares a bug fix
Scope (parser) Identifies the affected module
Separator : Required colon + space
Description handle escaped quotes in strings What the fix does

Scope Conventions

The scope should be a noun describing the section of the codebase:

  • Module names: (auth), (api), (parser)
  • Package names: (core), (cli), (ui)
  • Feature areas: (search), (checkout), (dashboard)

Version Impact

A fix commit triggers a patch version bump (e.g., 1.2.3 to 1.2.4) when using semantic versioning. The scope does not affect the version bump but improves the generated changelog by grouping fixes under their respective modules.

Common Mistakes with Scopes

  • Missing closing parenthesis: fix(parser: handle bug — the linter catches this.
  • Empty scope: fix(): handle bug — technically valid but discouraged.
  • Spaces in scope: fix(my parser): handle bug — avoid spaces; use hyphens instead.

Use Case

Use scoped fix commits in monorepos or larger projects where changes affect specific modules. The scope helps reviewers quickly identify which part of the codebase is touched and makes changelogs more organized when grouped by scope.

Try It — Conventional Commits Linter

Open full tool