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-width` shorthand
  • Loading branch information
mattxwang committed Jun 22, 2023
1 parent 16754b1 commit b900c7b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sixty-lies-repair.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `declaration-block-no-redundant-longhand-properties` autofix for `border-width` shorthand
2 changes: 1 addition & 1 deletion lib/reference/properties.js
Expand Up @@ -180,9 +180,9 @@ const longhandSubPropertiesOfShorthandProperties = new Map([
new Set([
// prettier-ignore
'border-top-width',
'border-right-width',
'border-bottom-width',
'border-left-width',
'border-right-width',
]),
],
[
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-width: 0px; border-right-width: 1px; border-bottom-width: 2px; border-left-width: 3px; }',
fixed: 'a { border-width: 0px 1px 2px 3px; }',
description: 'explicit border-width test',
message: messages.expected('border-width'),
},
],
});

Expand Down

0 comments on commit b900c7b

Please sign in to comment.