-
-
Notifications
You must be signed in to change notification settings - Fork 976
Labels
status: wipis being worked on by someoneis being worked on by someonesubtype: new rulean entirely new rulean entirely new rule
Description
What is the problem you're trying to solve?
I want to enforce consistent naming conventions for my layer names.
@layer foo {};
@layer bar;
@import "foo.css" layer(baz)
Ref: #7732 (comment)
What solution would you like to see?
A new rule:
- Name:
layer-name-pattern
- Description: Specify a pattern for layer names.
- Message:
Expected "${name}" to match pattern "${pattern}"
- Primary option:
string|regex
- Secondary options: None
- Category: Enforce conventions > Patterns
- Autofix?: No
- Included in sharable configs?: Yes (kebab case)
- Expanded description: N/A
Do we want to check the whole layer name or split the period-separated list of <ident>
s first?:
@layer framework.theme {}
My hunch is that we should check the whole name, as we can add a separate rule for enforcing specific idents, e.g., layer-name-ident-allowed-list: ["base", "framework", "theme"]
. The layer-name-pattern
is for users wanting to enforce a general pattern, e.g. kebab case, without enforcing specific names.
ybiquitous and ryo-manba
Metadata
Metadata
Assignees
Labels
status: wipis being worked on by someoneis being worked on by someonesubtype: new rulean entirely new rulean entirely new rule