Skip to content
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 end positions for declaration-block-no-* ("Avoid errors") #6040

Merged
merged 3 commits into from Apr 27, 2022

Conversation

mattxwang
Copy link
Member

@mattxwang mattxwang commented Apr 26, 2022

Which issue, if any, is this issue related to?

Part of the umbrella issue #5694.

Is there anything in the PR that needs further explanation?

This PR contains end positions for:

  • declaration-block-no-duplicate-custom-properties
  • declaration-block-no-duplicate-properties
  • declaration-block-no-shorthand-property-overrides

These are all of the rules matching declaration-block-no-* in the "Avoid Errors" section.

I don't mind adding support for declaration-block-no-redundant-longhand-properties as well (in "Enforce conventions"), though I'm a bit confused about how I would implement the start/end positions for this; what should I be highlighting? The actual shorthand (ex margin) doesn't appear in the code itself. Would I highlight each of the longhand properties separately?

Also, I manually did all the test cases included, though some double-checking for some of them would be nice! Pretty confident that they work as intended.

Copy link
Member

@ybiquitous ybiquitous left a comment

LGTM, thank you.

@ybiquitous
Copy link
Member

@ybiquitous ybiquitous commented Apr 26, 2022

I don't mind adding support for declaration-block-no-redundant-longhand-properties as well (in "Enforce conventions"), though I'm a bit confused about how I would implement the start/end positions for this; what should I be highlighting? The actual shorthand (ex margin) doesn't appear in the code itself. Would I highlight each of the longhand properties separately?

IMO, it's good to follow the current behavior. Currently, the rule warns at the start column of the last property (margin-left in the demo below), so it seems good that the end column also follows the last property. Any thoughts?

image

demo

@jeddy3 jeddy3 merged commit b06f324 into main Apr 27, 2022
17 checks passed
@jeddy3 jeddy3 deleted the end-positions-declaration-block-no branch Apr 27, 2022
@jeddy3
Copy link
Member

@jeddy3 jeddy3 commented Apr 27, 2022

IMO, it's good to follow the current behavior. Currently, the rule warns at the start column of the last property (margin-left in the demo below), so it seems good that the end column also follows the last property. Any thoughts?

SGTM.

@jeddy3
Copy link
Member

@jeddy3 jeddy3 commented Apr 27, 2022

  • Fixed: declaration-block-no-* end positions that avoid errors (#6040).

Copy link
Member

@jeddy3 jeddy3 left a comment

Looks great, thank you @mattxwang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants