conventional-changelog / conventional-changelog/commitlint

The "type-empty" rule does not work properly.

Open
#3,036 8 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
18.7k
Forks
970
Avg merge
7h 33m
Merged PRs (30d)
49

Description

When using the `type-empty` rule the separator `:` is still required.

## Expected Behavior

If the type is empty and the scope, there is no need to specify the `:` separator.

```shell
echo 'Toto' | commitlint #true
echo ': Toto' | commitlint #false
```

## Current Behavior

```js
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-empty': [2, 'always'],
},
}
```

```shell
echo 'Toto' | commitlint #false
echo ': Toto' | commitlint #true
```

## Affected packages

- [ ] cli
- [x] core
- [ ] prompt
- [ ] config-angular

## Possible Solution

A solution would be either to add a new rule (separator-empty) or to make the `type-empty` rule remove the `:` separator.

## Your Environment

| Executable | Version |
| ---------------------: | :------ |
| `commitlint --version` | @commitlint/cli@16.2.1 |
| `git --version` | git version 2.32.0 |
| `node --version` | v17.5.0 |

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.