From 6fb28946d691ef894cc5cb0b8978590fd48cc35d Mon Sep 17 00:00:00 2001 From: Grant Wong <2908767+dddlr@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:48:26 +1100 Subject: [PATCH] Fix border-inline-start and border-inline-end not having any valid ordering (#1756) * Fix border-inline-start and border-inline-end not having any valid ordering * Undo addition of packageManager --- .changeset/unlucky-boxes-brake.md | 6 ++++++ .../__tests__/rule.test.ts | 17 +++++++++++++++++ packages/utils/src/shorthand.ts | 6 ------ 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 .changeset/unlucky-boxes-brake.md diff --git a/.changeset/unlucky-boxes-brake.md b/.changeset/unlucky-boxes-brake.md new file mode 100644 index 000000000..947696d7d --- /dev/null +++ b/.changeset/unlucky-boxes-brake.md @@ -0,0 +1,6 @@ +--- +'@compiled/eslint-plugin': patch +'@compiled/utils': patch +--- + +Fix border-inline-start and border-inline-end not having any valid ordering in the shorthand-property-sorting ESLint rule diff --git a/packages/eslint-plugin/src/rules/shorthand-property-sorting/__tests__/rule.test.ts b/packages/eslint-plugin/src/rules/shorthand-property-sorting/__tests__/rule.test.ts index 79f9732da..bc78d56b6 100644 --- a/packages/eslint-plugin/src/rules/shorthand-property-sorting/__tests__/rule.test.ts +++ b/packages/eslint-plugin/src/rules/shorthand-property-sorting/__tests__/rule.test.ts @@ -269,6 +269,23 @@ tester.run('shorthand-property-sorting', shorthandFirst, { export const EmphasisText = ({ children, status }) => {children}; `, }, + + // + // has a valid sorting for borderInlineStart and borderInlineEnd + // + + { + name: 'has a valid sorting for borderInlineStart and borderInlineEnd', + code: ` + import { styled } from '@compiled/react'; + + const Bap = styled.div({ + borderTop: 'none', + borderInlineStart: 'none', + borderInlineEnd: 'none', + }); + `, + }, ]), invalid: includedImports.flatMap((imp) => [ diff --git a/packages/utils/src/shorthand.ts b/packages/utils/src/shorthand.ts index dfae0911a..4872662db 100644 --- a/packages/utils/src/shorthand.ts +++ b/packages/utils/src/shorthand.ts @@ -232,9 +232,6 @@ export const shorthandFor: Record 'border-inline-end-color', 'border-inline-end-style', 'border-inline-end-width', - 'border-left-color', - 'border-left-style', - 'border-left-width', 'border-right-color', 'border-right-style', 'border-right-width', @@ -246,9 +243,6 @@ export const shorthandFor: Record 'border-left-color', 'border-left-style', 'border-left-width', - 'border-right-color', - 'border-right-style', - 'border-right-width', ], 'border-left': [ 'border-inline-start-color',