question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

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

Current Behavior

module.exports = {
    extends: ['@commitlint/config-conventional'],
    rules: {
        'type-empty': [2, 'always'],
    },
}
echo 'Toto' | commitlint #false
echo ': Toto' | commitlint #true

Affected packages

  • cli
  • 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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
escapedcatcommented, Feb 19, 2022

Thanks! You think it would be good to mention it i.e. here?: https://commitlint.js.org/#/reference-community-projects

1reaction
FelixLgrcommented, Feb 19, 2022

Ah ok, yeah, that makes sense. You have a link to that config?

https://www.npmjs.com/package/commitlint-config-gitmoji

Read more comments on GitHub >

github_iconTop Results From Across the Web

husky - Strange error when attempting to commit. [subject-empty]
There is a package called husky that defines a certain template for your commit messages. If the template is not fulfilled, one gets...
Read more >
Commitlint: Write more organized code - LogRocket Blog
Make your life easier as a developer by using commitlint to format, standardize, and organize code and messages.
Read more >
GNU make
Invoking make from makefiles. • Canned Recipes, Defining canned recipes. • Empty Recipes, Defining useful, do-nothing recipes. Recipe ...
Read more >
Google JavaScript Style Guide
Like other programming style guides, the issues covered span not only aesthetic issues of formatting, but other types of conventions or coding standards...
Read more >
Effective Dart: Usage - Dart programming language
DON'T explicitly initialize variables to null . Linter rule: avoid_init_to_null. If a variable has a non-nullable type, Dart reports a compile error if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found