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

new eslint rule to expand border shorthand property #1741

Closed
wants to merge 2 commits into from

Conversation

zesmith2
Copy link
Collaborator

@zesmith2 zesmith2 commented Nov 5, 2024

What is this change?

Adding an eslint rule that expands border shorthand property into it's longhand parts borderStyle, borderWidth, and borderColor.

border property supports borderStyle, borderWidth being in either order, and borderColor always coming last. This rule supports this allowance, and only applies to shorthand that has all 3 properties present,

e.g. border: '1px', isn't covered in this rule.

Why are we making this change?

Expanding the border property will decrease stylesheet size due to more common usages without all properties matching.

PR checklist

Don't delete me!

I have...

  • Updated or added applicable tests
  • Updated the documentation in website/

Copy link

changeset-bot bot commented Nov 5, 2024

🦋 Changeset detected

Latest commit: 27c49db

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

This PR includes changesets to release 1 package
Name Type
@compiled/eslint-plugin 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

netlify bot commented Nov 5, 2024

Deploy Preview for compiled-css-in-js canceled.

Name Link
🔨 Latest commit 27c49db
🔍 Latest deploy log https://app.netlify.com/sites/compiled-css-in-js/deploys/6729918280c66700082cc8fc

/* borderStyle borderWidth borderColor */

...packages_calls_and_imports.map(([pkg, call, imp]) => ({
name: `borderStyle:keyword, borderWidth:px, borderColor:rgb - single property (${call}, ${imp})`,
Copy link
Collaborator Author

@zesmith2 zesmith2 Nov 5, 2024

Choose a reason for hiding this comment

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

spaces included in test name so it's easier to scan test names upon running
Screenshot 2024-11-05 at 1 49 12 PM

@zesmith2 zesmith2 closed this Nov 5, 2024
@zesmith2
Copy link
Collaborator Author

zesmith2 commented Nov 5, 2024

Moving this to AFM

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

Successfully merging this pull request may close these issues.

1 participant