-
Notifications
You must be signed in to change notification settings - Fork 313
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
feat: add autofix for logical to inline properties in valid-styles rule #805
Conversation
cc2c16c
to
d19c205
Compare
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
errors: [ | ||
{ | ||
message: | ||
'The key "marginStart" is not allowed by stylex. Use "marginInlineStart" instead.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like this:
"The key 'marginStart' is not a standard CSS property. Did you mean 'marginInlineStart'?"
Communicating that it's non-standard is useful context for people
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (once message bikeshedding is complete)
I had to google this #til Parkinson's Law of Triviality |
Context
As per internal discussions, let's add an autofix into the valid-styles rule. Some of this logic exists in the valid-shorthands rule, but it makes sense to move the erroring here for the repos in which valid-shorthands is not enabled.
I've kept the descriptor in the autofix short and simple to avoid clutter on a lint error that will likely crop up a lot, but can also link to https://fb.workplace.com/groups/stylexfyi/posts/1769833193785624 or something related as context. Open to feedback here!
As a next step, we should work towards splitting up the valid-styles rule into more discrete chunks to increase the granularity of error reporting/messaging (perhaps after the codemodding)
Tests
Added tests for the following styles:
Pre-flight checklist
Contribution Guidelines