Skip to content

Commit b589391

Browse files
committed
feat: support using delimiter in scope-enum
1 parent 25926c6 commit b589391

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

@commitlint/rules/src/scope-enum.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export const scopeEnum: SyncRule<string[]> = (
2020
let isValid;
2121

2222
if (when === 'never') {
23-
isValid = !messageScopes.some(isScopeInEnum);
23+
isValid = !messageScopes.some(isScopeInEnum) && !isScopeInEnum(scope);
2424
errorMessage.splice(1, 0, 'not');
2525
} else {
26-
isValid = messageScopes.every(isScopeInEnum);
26+
isValid = messageScopes.every(isScopeInEnum) || isScopeInEnum(scope);
2727
}
2828

2929
return [isValid, message(errorMessage)];

0 commit comments

Comments
 (0)