-
Notifications
You must be signed in to change notification settings - Fork 386
feat(babel-plugin): add disallowedPropertiesValidation option #1424
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(babel-plugin): add disallowedPropertiesValidation option #1424
Conversation
Add config option to control validation behavior for disallowed shorthand properties (border, background, animation, etc). Options: 'throw' (default), 'warn', 'silent' Fixes facebook#1423
|
@Faizanq is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @Faizanq! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
nmn
left a comment
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.
This looks good for now. We should update the babel plugin to never throw on these properties by default, and create a new option to manually validate for React Native instead.
packages/@stylexjs/babel-plugin/src/shared/preprocess-rules/index.js
Outdated
Show resolved
Hide resolved
packages/@stylexjs/babel-plugin/src/shared/utils/default-options.js
Outdated
Show resolved
Hide resolved
…ertyValidationMode - Renamed option per review feedback - Changed default from 'throw' to 'silent' (less noisy) - Simplified warning message
|
We might want to log in dev or for RN but can follow up with a patch |
Add config option to control validation behavior for disallowed shorthand properties (border, background, animation, etc).
Changes
disallowedPropertiesValidationoption with three modes:'throw'(default): Throws error for disallowed properties'warn': Logs warning and skips property'silent': Silently skips propertyUse case
Allows gradual migration of existing codebases that use disallowed shorthand properties without breaking the build.
Fixes #1423