-
-
Notifications
You must be signed in to change notification settings - Fork 533
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(lint/css): implement noImportant
rule
#5126
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #5126 will degrade performances by 45.74%Comparing Summary
Benchmarks breakdown
|
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.
The rule can be simplified by querying the node CssDeclarationImportant
. That should fix the degradation we have in performance
436e02e
to
1ea3902
Compare
markup! { | ||
"Unexpected "<Emphasis>"!important"</Emphasis>" declaration." | ||
}, | ||
) | ||
.note(markup! { | ||
"Using "<Emphasis>"!important"</Emphasis>" breaks the natural cascading of CSS rules and makes styles harder to maintain." | ||
}), |
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.
This message is almost on the mark with our rule pillars. It's missing the "what the user should do" part. Typically, we have the .note(<message>)
part do this.
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.
Do you have any text suggestions?
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.
The suggestion would be to implement a code action to remove !important
, or to provide a message to remove it.
The rule noDebugger
provides a code action, maybe this rule should too.
Should we call it |
Summary
Closes #5039
Test Plan
Added tests.