-
-
Notifications
You must be signed in to change notification settings - Fork 986
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'd like to require @layer and other at-rules around my declarations.
Allow:
@layer defaults {
a { color: red; }
}Disallow:
a { color: red; }What solution would you like to see?
We typically enable users to do this on the configuration level by adding generic and configurable rules rather than specific ones.
A new rule to do this.
- Name:
declaration-nesting-at-rule-required-listdeclaration-block-nesting-at-rule-required-list - Description: Specify a list of required nesting at-rules for declarations.
- Message:
Expected nesting at-rule "${atRule}" for declaration - Primary option:
array[string|regex]|string|regex - Secondary options: None
- Category: Enforce conventions > Allowed, disallowed & required
- Autofix?: No
- Included in sharable configs?: No
- Expanded description: N/A
{
"rules": {
"declaration-nesting-at-rule-required-list": ["layer", "scope"]
}
}Prior art: use-layers.
Metadata
Metadata
Assignees
Labels
status: wipis being worked on by someoneis being worked on by someonesubtype: new rulean entirely new rulean entirely new rule