Allow per-type scope-enum
See original GitHub issueExpected Behavior
I’d like to limit the valid scopes on a per-type basis. For example, the docs
type should accept all
and each of my lerna packages as scopes, but the build
type should perhaps accept only npm
, webpack
, babel
.
Current Behavior
I can specify valid types and valid scopes, but not tuples of which ones are valid together.
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
Allow one (or both) of scopes-enum
and types-enum
to accept an object instead of an array. Alternatively, introduce a new rule that accepts an object.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Spring scope references as enums? [duplicate] - Stack Overflow
PROTOTYPE, Scope. SINGLETON static references? Or do I always have to use non-typesafe strings as scopes?
Read more >Access control for enum cases - Pitches - Swift Forums
Today, Swift doesn't allow access control modifiers on enum cases, unlike properties, methods and other kinds of declarations.
Read more >Singleton and Prototype Bean Scopes in Java Spring
By default scope is not prototype so you have to declare the scope of a been as prototype explicitly. Singleton scope should be...
Read more >Scope - cppreference.com
block scope; file scope; function scope; function prototype scope ... the scopes are nested (no other form of scope overlap is allowed), and...
Read more >Scope - cppreference.com
Contents · [edit] Block scope · [edit] Function prototype scope · [edit] Function scope · [edit] Namespace scope · [edit] Class scope ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into the need for per-type scopes myself and after digging around a bit ended up implementing it as a local plugin. If there’s interest, I can clean up the code and publish it on npmjs. In the meantime, here’s my ugly working
commitlint.config.js
in case its helpful to anyone:Thank you @njlaw
I converted it to an actual plugin, here: commitlint-plugin-selective-scope