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 declaration-block-no-redundant-longhand-properties false positives for inherit keyword #6419

Merged
merged 7 commits into from Oct 21, 2022

Conversation

kimulaco
Copy link
Member

@kimulaco kimulaco commented Oct 20, 2022

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

Closes #6394

Is there anything in the PR that needs further explanation?

I think this CSS spec is often overlooked. So, I added a description and example to the docs. 94a21c3

@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2022

🦋 Changeset detected

Latest commit: f442a05

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

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

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

@kimulaco Thank you for creating the pull request. Adding a note about inherit to the rule doc is a nice idea!

I've left a few trivial suggestions, but this change almost looks good. 👍🏼

.changeset/fair-oranges-love.md Outdated Show resolved Hide resolved
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

Thank you.

I've requested a change to the docs.

Comment on lines 148 to 159
You should use a longhand property to have only the specific value inherited. So, the following patterns are also not considered problems:

<!-- prettier-ignore -->
```css
a {
margin-top: 1px;
margin-right: 2px;
margin-bottom: 3px;
margin-left: inherit;
}
```

Copy link
Member

Choose a reason for hiding this comment

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

Let's remove this as our patterns don't tend to show edge cases.

We can add something to do extended description at the top instead. For example, expand the following line

This rule will only complain if you've used the longhand equivalent of all the properties that the shorthand will set.

To:

"This rule will only complain if you've used the longhand equivalent of all the properties that the shorthand will set and if their values are not inherit."

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for review! I removed a description of edge case. 616a536
Then, I updated the description to your suggestion. f442a05

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

Thank you. LGTM!

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes. LGTM.

@jeddy3 jeddy3 merged commit e3585ed into stylelint:main Oct 21, 2022
@kimulaco kimulaco deleted the fix/6394 branch October 23, 2022 03:16
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.

Fix declaration-block-no-redundant-longhand-properties false positives for inherit keyword
3 participants