feat: add suggestions to no-empty-blocks#479
Open
k-yle wants to merge 1 commit into
Open
Conversation
3 tasks
DMartens
reviewed
Jun 28, 2026
DMartens
reviewed
Jun 28, 2026
|
Thank you for the PR. Just found two small refactorings using more appropriate methods. |
7790a62 to
a91126c
Compare
Pixel998
requested changes
Jun 29, 2026
|
|
||
| messages: { | ||
| emptyBlock: "Unexpected empty block found.", | ||
| deleteEmptyBlock: "Delete the empty block.", |
Contributor
There was a problem hiding this comment.
This is slightly misleading since fixer.remove(parent) removes the entire rule, not just the block.
| parent.name === "layer"; | ||
|
|
||
| return fixer.remove( | ||
| isAtLayer ? node : parent, |
Contributor
There was a problem hiding this comment.
Removing the block of a named layer can cause a parsing error (explorer). Instead, it needs to be replaced with a semicolon to become a valid layer statement. For unnamed layers, I think it is fine to remove the entire rule.
Because of this distinction, we should probably split this into two separate suggestions:
removeRule: "Remove the empty rule.",
convertToStatement: "Convert to layer statement.",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites checklist
AI acknowledgment
(If the above is not checked) I have reviewed the AI-generated content before submitting.What is the purpose of this pull request?
Add sugggestions to
no-empty-blocks. There are two different cases:@layer name {}becomes@layer namea {}becomeWhat changes did you make? (Give an overview)
Related Issues
Closes #476
Is there anything you'd like reviewers to focus on?
@layeras mentioned above). I have asked a senior colleague and Claude Opus 4.8, both of whom agreed.