-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add use-layers rule #27
base: main
Are you sure you want to change the base?
Conversation
Looks great!
I think so. I had the same thought before seeing this PR. |
@fasttime I can't quite figure out why the type tests are failing now. Can you take a look? |
@jeddy3 thanks, updated! |
I think I figured out the types issue: #28 |
I fixed the bug in CSS Tree with layer positioning. Just waiting for a new release to update this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added two suggestions for extra tests.
I think I'd find it more intuitive if the boolean options matched, i.e. both made the rule stricter or more permissive.
For example, either:
allowUnnamedLayers: false
allowUnLayeredImports: false
or:
requireNamedLayers: true
requireImportLayers: true
With CSSTree updated, all of the locations are now correct. 🎉 |
Prerequisites checklist
What is the purpose of this pull request?
Add a new
use-layers
ruleWhat changes did you make? (Give an overview)
use-layers
ruleNote: This rule is not recommended because it will likely only be useful on a subset of CSS files in any given project.
Related Issues
fixes #18
Is there anything you'd like reviewers to focus on?
ShouldYes!@import
require a layer by default? Right now it doesn't, but I feel like maybe it should.