Skip to content

Commit

Permalink
Fix declaration-block-no-redundant-longhand-properties autofix for …
Browse files Browse the repository at this point in the history
…`border-radius` shorthand (#6958)

Ref: #6956 (comment)
  • Loading branch information
mattxwang committed Jun 23, 2023
1 parent db315b1 commit 00803ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/violet-otters-rule.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `declaration-block-no-redundant-longhand-properties` autofix for `border-radius` shorthand
2 changes: 1 addition & 1 deletion lib/reference/properties.js
Expand Up @@ -141,8 +141,8 @@ const longhandSubPropertiesOfShorthandProperties = new Map([
'border-radius',
new Set([
// prettier-ignore
'border-top-right-radius',
'border-top-left-radius',
'border-top-right-radius',
'border-bottom-right-radius',
'border-bottom-left-radius',
]),
Expand Down
Expand Up @@ -206,6 +206,12 @@ testRule({
description: 'autofixer should not mangle css functions with comma separated values',
message: messages.expected('transition'),
},
{
code: 'a { border-top-left-radius: 1em; border-top-right-radius: 2em; border-bottom-right-radius: 3em; border-bottom-left-radius: 4em; }',
fixed: 'a { border-radius: 1em 2em 3em 4em; }',
description: 'explicit border-radius test',
message: messages.expected('border-radius'),
},
{
code: 'a { border-top-width: 0px; border-right-width: 1px; border-bottom-width: 2px; border-left-width: 3px; }',
fixed: 'a { border-width: 0px 1px 2px 3px; }',
Expand Down

0 comments on commit 00803ea

Please sign in to comment.