# ✖ subject may not be empty [subject-empty] ✖ type may not be empty [type-empty]

**Code:** `commitlint: subject may not be empty / type must be one of` · **Category:** Git · **Seen on:** Git

A commit-msg hook (commitlint) rejected your message format.

## Meaning

Follow Conventional Commits: `type(scope): subject` such as `feat(auth): add login`. See the config for allowed types.

## Common causes

- Message doesn't match convention
- Merge/revert messages not exempt
- Empty subject

## Quick fix

1. Use `feat:`/`fix:`/`chore:` prefixes
2. Check `commitlint.config.js`
3. Amend the message

## Detailed fix by platform

### Shell

1. `git commit -m "fix(api): handle null response"`

## How to diagnose

1. **Format** — type: subject?
2. **Types** — allowed?
3. **Config** — which?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/git/commit-msg-hook-commitlint)
