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
Fix declaration-block-no-redundant-longhand-properties
with basic keywords
#6748
Fix declaration-block-no-redundant-longhand-properties
with basic keywords
#6748
Conversation
🦋 Changeset detectedLatest commit: ceafc35 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
2ff0bd7
to
41b76d3
Compare
@mattxwang Thanks for the pull request!
How do you estimate the work? We could address it with another pull request if it is a bit hard. |
lib/rules/declaration-block-no-redundant-longhand-properties/README.md
Outdated
Show resolved
Hide resolved
I think leaving it to another PR is a good idea; in particular, this PR reduces false positives, while the other change would reduce false negatives. I can open an issue and allow for some discussion after merging this PR! |
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
…properties-basic-keywords
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.
Thanks, LGTM 👍🏼
After upgrading to 15.4.0 I started noticing .example {
position: absolute;
top: 0;
right: 0;
bottom: 0;
/* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
left: 0;
} |
@pbojinov You mean you don't want to use the As another way, you can either turn off the rule or ignore only {
"rules": {
"declaration-block-no-redundant-longhand-properties": null
}
} {
"rules": {
"declaration-block-no-redundant-longhand-properties": [true, {"ignoreShorthands": ["inset"]}]
}
} |
related: #7214 (comment) |
Sorry, I think I'm missing something - how is this related to the linked comment? I can submit a fix if so (since I probably introduced the bug 😓 ) |
It's just a reminder so that, if we tackle "CSS-wide keywords" for this rule, we take into account what has been learned from this PR. You don't have to do anything :) |
Closes #6738.
The scope of this PR is broader than autofixing, since we also shouldn't flag instances which use a basic keyword. Let me know if additional test cases / documentation are desired!
Note that we already had this feature for
inherit
; this PR just expands it to usebasicKeywords
.If we'd like, we could also create a more "aggressive" approach that converts
to
which is valid (to my understanding). The rule doesn't currently behave this way with
inherit
; but, happy to add this if we think it's helpful!Spec ref for shorthand properties not supporting CSS-wide keywords: