Skip to content

Unable to commit when type-enum is overridden #2384

Closed
@johanvergeer

Description

@johanvergeer

I'm not able to do a commit when I override the type-enum rule in commitlint.config.js.

When I don't override the type-enum rule a commit is not blocked.

Expected Behavior

The commit should be done.

Current Behavior

When I do a commit with using an approved type, I still get an error message:

echo 'feat(hello): bar' | commitlint
⧗   input: feat(hello): bar
✖   type must be one of [feat,fix,docs,style,refactor,test,revert,content] [type-enum]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

  1. Create commitlint.config.js with the config I put above
  2. Run commitlint and see the magic happen
commitlint.config.js ```js module.exports = { extends: ['@commitlint/config-conventional'], rules: { 'type-enum': [ 2, 'always', [ [ 'feat', 'fix', 'docs', 'style', 'refactor', 'test', 'revert', 'content', // For articles, tutorials, etc... ], ], ], }, } ```

Context

I would like to create a custom type for articles and tutorials on my blog.

Your Environment

Executable Version
commitlint --version @commitlint/cli@11.0.0
git --version git version 2.21.1 (Apple Git-122.3)
node --version v15.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions