Skip to content

feat: [scope-enum] [scope-case] allow space after comma as scope delimiter #3576

Closed
@miluoshi

Description

@miluoshi

Expected Behavior

scope-enum and scope-case rules should also accept comma with space , as a delimiter in addition to /, \, ,

Current Behavior

  • type(scope1,scope2,scope3): msg passes
  • type(scope1, scope2, scope3): msg fails

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

No response

Steps to Reproduce

1. enable rule `'scope-enum': [2, 'always', ['scope1', 'scope2']],`
2. run `echo "type(scope1, scope2, scope3): msg" | commitlint

Context

It's quite common for developers to separate multiple scopes with , instead of ,. It leads to frustration finding that commitlint failed just because of a space (which improves readability)

commitlint --version

@commitlint/cli@17.4.4

git --version

v2.38.1

node --version

v18.12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions