Skip to content

Conversation

@thecalamiity
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request?

This pull request enhances the no-important rule by providing a suggestion to remove the !important flag from CSS declarations.

What changes did you make? (Give an overview)

  • Added a suggestion to the no-important rule that removes the !important flag from CSS declarations.
  • Updated the test suite to verify that suggestions are provided and that the output matches the expected code with only the !important flag removed.

Related Issues

Fixes #204

Is there anything you'd like reviewers to focus on?

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jul 29, 2025
@lumirlumir lumirlumir added the accepted There is consensus among the team that this change meets the criteria for inclusion label Jul 29, 2025
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good start. Just a couple of bits to clean up.

@nzakas nzakas moved this from Needs Triage to Implementing in Triage Jul 29, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, if somehow the CSS comment before the !important flag contains the !important, then the rule reports the one inside the comment.

a { color: red /* !important flag 1 */ !important; }


/* after fix the output will be */
a { color: red /*  flag 1 */ !important; }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #218 to address this.

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@nzakas nzakas merged commit 47e26b3 into eslint:main Jul 31, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion contributor pool feature

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Rule Change: Add autofix capability to the no-important rule

4 participants